Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- public class StringDemo
- {
- static String str1 = "Hello world";
- public static void main(String args[])
- {
- String str2 = "Hello world";
- String str3 = new String(str1);
- System.out.println(str1 == str2);
- System.out.println(str1.equals(str2));
- System.out.println(str3 == str1);
- System.out.println(str3.equals(str1));
- }
- }
b. line 9, 11
c. line 8, 10
d. line 8

Post new comment