- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtutorial_14.java
More file actions
Latest commit
20 lines (14 loc) · 608 Bytes
/
Copy pathtutorial_14.java
File metadata and controls
20 lines (14 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
classDriver {
publicstaticvoidmain(String[] args) {
StringfirstName = "Luke";
StringlastName = "Miller";
byteage = 32;
doublecarCost = 82382.32342;
System.out.printf("My name is %s %.1s., and I'm %d years old.\n", firstName, lastName, age);
System.out.format("I own a $%,.2f car.", carCost);
StringfullName = String.format("%s %s", firstName, lastName);
System.out.printf(" Which is good for being in my %.1s0s", age );
// old way of doing things
System.out.println("\n" + fullName + " is my name.");
}
}