Java Strings: Default values for String variables and String arrays

Опубликовано: 28 Январь 2019
на канале: colleen lewis
39,834
20

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;
}
}