String equality and operators
Last updated
Last updated
package com.test.test1;
public class StringMethods {
public static void main(String[] args) {
String day = "OCJA" + "Cert" + "Exam";
System.out.println(day);
}
}
package com.test.test1;
public class StringMethods {
public static void main(String[] args) {
int num = 10;
int val = 12 ;
String aStr = "OCJA";
String anotherStr = num + val + aStr;
System.out.println(anotherStr);
}
}
package com.test.test1;
public class StringMethods {
public static void main(String[] args) {
int num = 10;
int val = 12;
String aStr = "OCJA";
String anotherStr = "" + num + val + aStr;
System.out.println(anotherStr);
}
}
package com.test.test1;
public class StringMethods {
public static void main(String[] args) {
String lang = "Java";
lang += " is everywhere!";
String initializedToNull = null;
initializedToNull += "Java";
System.out.println(initializedToNull);
}
}