- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintMethods.java
More file actions
Latest commit
18 lines (17 loc) · 742 Bytes
/
Copy pathPrintMethods.java
File metadata and controls
18 lines (17 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
publicclassPrintMethods{
publicstaticvoidmain(String[] args){
//Using the print()
System.out.print("\"Learn Java Is Fun\"\n");
System.out.print(" Hey, come and learn Java with me");
//Using the println()
System.out.println();
System.out.println("I want to tell you that Java is different from Javascript");
System.out.println("\t this is the indented text");
//Using the printf()
System.out.printf("My name is %sand I love Java %n","John");
System.out.printf("I am living in No. %d kaduna street %n",1);
System.out.printf("I bought Java JDK with %f Naira %n",159.345);
System.out.printf("I bought Java JDK with %.1f Naira %n",159.345);
System.out.printf("I bought Java JDK with %c%f ",'$', 159.345);
}
}