package class5_3_Libraries; import java.text.DecimalFormat; import java.util.Random; public class Example { public static void main(String[] args) { // toString int x = 5; System.out.println("x is: "+x); // A same as B String str = "x is: "+x; // x.toString(); not allowed for primitives System.out.println("x is: "+Integer.toString(x)); // B same as A String str2 = "x is: "+Integer.toString(x); System.out.println("x is: "+Long.toString((long)x)); String str3 = Integer.toString(x); String str4 = ""+x; // Case changes char letter = 'A'; letter = Character.toLowerCase(letter); String word = "Class"; word = word.toLowerCase(); String word2 = "Joe"; if(word2.isEmpty()) { System.out.println("Empty string!"); } else { System.out.println(word2); } int index = word2.indexOf('e'); System.out.println("Index of e: "+index); //Random Random generator = new Random(); int randomInt = generator.nextInt(2)+1; DecimalFormat formatter = new DecimalFormat("#.#"); System.out.println("Pi is: " + formatter.format(Math.PI)); System.out.println("sqrt(2): " + formatter.format(Math.sqrt(2.0))); ///////////------------- OOP -----------------/////// int count = 4; long millis = 3000000; String str7 = "Joe"; String str8 = str7.toLowerCase(); str7.toUpperCase(); str7.charAt(0); } }