-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutput.java
More file actions
22 lines (18 loc) · 1 KB
/
Copy pathOutput.java
File metadata and controls
22 lines (18 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package String;
// Ways of printing of string
public class Output {
public static void main(String[] args) {
System.out.println(56);
// Integer num = new Integer(56);
// System.out.println(num.toString());
// System.out.println(num);
// System.out.println("Kunal");
// System.out.println(Arrays.toString(new int[]{2, 3, 4, 5}));
////
// String name = null;
// System.out.println(name);
}
}
// when we print any integer or array or string, it gets converted into strings internally (they are calling .toString method internally) that's what we see in the console is the string representation of the array or whatever we pass
// It uses the method-overloading technique to decide which method to call when we pass integer, array or anything (by using method overloading)
// check the internal working of each print method (using ctrl+"left mouse key") to check which method they are calling internally to understand the working of each called function/method.