Difference between String literal and New String object in Java

preview_player
Показать описание
#JavaTutorial #JavaStringTutorial #JavaStringVSNewStringObject

Difference between String literal and New String object in Java

Like, Share, And Subscribe | Professor Saad Yousuf

This tutorial is about Programming in Difference between String literal and New String object in Java

public class LiteralStringVSStringObject {

public static void main(String[] args) {
String name1 = "John";
String name2 = "John";

String name3 = new String("John");
String name4 = new String("John");


}

}
Рекомендации по теме
Комментарии
Автор

Interesting, I like these kind of tutorials, short enough to watch at any time and very informative. Thanks.

NickOtonglo
Автор

i think the diagram is wrong s1 n s2 should be replaced by s3 n s4 n vice versa

arjun