Java Strings
Text in Java.
Examples
Create String
Basic string creation and length check.
public class Main {
public static void main(String[] args) {
String txt = "Hello World";
System.out.println(txt);
System.out.println(txt.length());
}
}String Methods
Converting to uppercase and lowercase.
public class Main {
public static void main(String[] args) {
String txt = "Hello World";
System.out.println(txt.toUpperCase());
System.out.println(txt.toLowerCase());
}
}Test Your Knowledge
Java Quiz
No quiz available for this topic yet.