public class Name { public static void main(String[] ughs) { System.out.println("Hello World!"): } }
System.out.print("Hello"); System.out.print("World"!);
public class Name { public static void main(String[] ughs) { int number = 0, Number = 1; double nUmber = 2.01, nuMber = 3; int numBer = number + Number; int numbEr = number + nUmber; double numbeR = number + nuMber; } }
int numbEr = number + (int) nUmber;
System.out.println("Number = " + Number);
String word = "Hello World!";
String s = computer;
System.out.println(s.charAt(2));
System.out.print(s.length());
System.out.println(s.sub string(4));
System.outprint(s.indexOf("o"));
int number = 1; if (number < 0) { System.out.println("Number is less than zero."); } else if (number == 0) { System.out.println("Number is zero."); } else { System.out.println("Number greater than zero."); }
String word = "hello", Word = "world"; if (word.equals(world) System.out.println("word is the same as Word."); else System.out.println("Word is no the same as Word."); if (word.equals("hello") System.out.println("word is \'hello\'."); else System.out.prtinln("word is \'"+word+"\'.");
int count; for(count = 1; count <= 5; count = count + 1) { System.out.println(count); }
int count = 1; while (count < 10) { System.out.print(count); count++; }
int count1, count2, sum; for(count1 = 1; count1 <= 4; count1++) { for (count2 = 1; count2 <= 5; count2++) { sum = count1 + count2; System.out.print(sum + " "); } System.out.println();
import chn.util.*;
int num = input.readInt();
int num; System.out.print("Num = "); num = input.readInt();