Upload files to "OOP/Java/Lab/Week9"
This commit is contained in:
parent
e9a4ce08c7
commit
cd43a87e9b
5 changed files with 99 additions and 0 deletions
15
OOP/Java/Lab/Week9/concat_5.java
Normal file
15
OOP/Java/Lab/Week9/concat_5.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
import java.util.Scanner;
|
||||
public class concat_5 {
|
||||
public static void main(String[] args) {
|
||||
Scanner sc = new Scanner(System.in);
|
||||
String concatString = "";
|
||||
System.out.println("Enter five strings separately:");
|
||||
for (int i = 1; i<= 5; i++) {
|
||||
System.out.print("Enter string " + i + ": ");
|
||||
String inputString = sc.nextLine();
|
||||
concatString.concat(inputString);
|
||||
|
||||
}
|
||||
System.out.println("Concatenated String: " + concatString);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue