java new string array
String[] myStringArray = new String[3];
String[] myStringArray = {"a", "b", "c"};
String[] myStringArray = new String[]{"a", "b", "c"};
java new string array
String[] myStringArray = new String[3];
String[] myStringArray = {"a", "b", "c"};
String[] myStringArray = new String[]{"a", "b", "c"};
array of string java
//store input string in an array with an length unknown
Scanner scanner = new Scanner(System.in);
String[] string = scanner.nextLine().split(" ");
array in java
//method 1
int[] age = new int[3];
age[0] = 1;
age[1] = 3;
age[2] = 6;
for (int i=0; i < 3; i++)
System.out.println(age[i]);
//method 2
int[] num = {3,3,5};
//int num[] = {3,3,5}; also works the same
System.out.println(num[0]);
an array of names for java
String[] names = {
"Liam",
"Olivia",
"Noah",
"Emma",
"Oliver",
"Ava",
"William",
"Sophia",
"Elijah",
"Isabella",
"James",
"Charlotte",
"Benjamin",
"Amelia",
"Lucas",
"Mia",
"Mason",
"Harper",
"Ethan",
"Evelyn"
};
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us