filmov
tv
Java Strings: Default values for String variables and String arrays

Показать описание
Being able to trace how programs work by drawing memory models is super important!
Here we focus on the default value of String variables and String arrays.
public class JavaPractice {
public static void main(String[] args){
String str1 = new String("Team");
String str2;
String[] arr = new String[3];
arr[1] = new String("Hello");
arr[2] = str1;
}
}
Here we focus on the default value of String variables and String arrays.
public class JavaPractice {
public static void main(String[] args){
String str1 = new String("Team");
String str2;
String[] arr = new String[3];
arr[1] = new String("Hello");
arr[2] = str1;
}
}