String myString = "Hello World!"; System.out.println(myString);
String firstName = "John"; String lastName = "Doe"; String fullName = firstName + " " + lastName; System.out.println(fullName);
String myString = "hello world!"; String uppercaseString = myString.toUpperCase(); System.out.println(uppercaseString);This code converts a String to uppercase and creates a new String. The output will be "HELLO WORLD!". The java.lang package library is a part of the Java Standard Library and contains fundamental classes and interfaces that are used throughout Java programs. The java.lang package is automatically imported in every Java program, which is why it is not necessary to import it explicitly.