//Example: Using the class of String public class Stringthing { public static void main(String[] args) { // let us make a 2 new variables String s,t; // let us now make new objects of that type s = new String("Hi there"); t = new String("Go away"); // let us now output the strings System.out.println(s); System.out.println(t); // let us access a method from each System.out.println(s.substring(0,2)); System.out.println(t.substring(0,2)); // let us access another method from each System.out.println(s.length()); System.out.println(t.length()); } }