public class Hello {
// start attributes
// end attributes
// start methods
public static void main(String argu[]) {
char c = 'a';
c++;
System.out.println("the value of c is="+ c);
double y = (3/5);
System.out.println(y);
System.out.println('b');
//System.out.println ((char)('b' + 'c'));
System.out.println((char) ('a' + 4));
int a = 2 * '1';
System.out.println(a);
//boolean b = 1;
boolean f = true;
// boolean d = "true";
//boolean e = True;
int i =1; int x=0; x= ++i * i + ++i * i; System.out.println(x);
int j =2; x=0; x= ++j * ++j - j * j; System.out.println(x);
int k =2; x=0; x= ++k * k * ++k ; System.out.println(x);
int l =2; x=0; x= ++l * l + ++l ; System.out.println(x);
System.out.println("\"");
}
// end methods
}
Tuesday, 23 January 2018
Related Posts:
Read string in javaimport java.io.*;public class ReadString { public static v… Read More
simple java programspublic class Hello { // start attributes // … Read More
java welcome class 2/* welcome2*/// Welcome to Java, example 2: Text-printing program.publ… Read More
Simple Addition In javapublic class addition { public static void main(String[] a… Read More
0 comments: