Public Class Public Static Void Int Int Long Long: Page 1 of 6
Public Class Public Static Void Int Int Long Long: Page 1 of 6
(" i +
(" i (" x *
(" x /
(" i *
(" i /
(" i %
(" i /
("");
(" i =
(" j =
j
j
y
y
x
x
x
x
=
=
=
=
+
+
-
"
"
"
"
y
y
y
y
+
+
+
+
*
/
*
%
.......);
.......);
.......);
.......);
j = " + ...............);
j = " + ...............);
j = " + ...............);
j = " + ...............);
System.out.println
System.out.println
System.out.println
System.out.println
System.out.println
System.out.println
System.out.println
}
}
" + .......);
" + .......);
Page-1-1 of 6
Page-1-2 of 6
Page-1-3 of 6
4. import java.util.*;
public class relasi {
public static void main(String[] args) {
String s1="Cat";
String s2="Dog";
String s3="Cat";
String s4="Dog";
System.out.println("Relasi");
System.out.println("===========");
if (s1.compareTo(s2) !=0)
System.out.println("cat no dog");
if (s1.compareTo(s3) ==0)
System.out.println("cat is cat");
if (s2.compareTo(s4) ==0)
System.out.println("dog is dog");
}
}
Page-1-4 of 6
Page-1-5 of 6
Page-1-6 of 6