//PROGRAM 11-21 class DemoCariString { public static void main(String[] args) { String s = "Tutorial Java: " + "Kursus Singkat Pemrograman Java"; System.out.println("s = \"" + s + "\""); System.out.println(); System.out.println("s.indexOf(\'J\') : " + s.indexOf('J')); System.out.println("s.indexOf(\"Java\") : " + s.indexOf("Java")); System.out.println("s.lastIndexOf(\'J\') : " + s.lastIndexOf('J')); System.out.println("s.lastIndexOf(\"Java\") : " + s.lastIndexOf("Java")); System.out.println(); System.out.println("s.indexOf(\'J\', 10) : " + s.indexOf('J', 10)); System.out.println("s.indexOf(\"Java\", 10) : " + s.indexOf("Java", 10)); System.out.println("s.lastIndexOf(\'J\', 15) : " + s.lastIndexOf('J', 15)); System.out.println("s.lastIndexOf(\"Java\", 15) : " + s.lastIndexOf("Java", 15)); } }