Created
October 3, 2022 22:02
-
-
Save rmg007/4cac7afdca694ca6cfe1fb7ea17a9aa2 to your computer and use it in GitHub Desktop.
learn and dive deep in Java Course. Wrapper Classes lecture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Main { | |
| public static void main(String[] args) { | |
| System.out.println("byte min : " + Byte.MIN_VALUE + ", byte max : " + Byte.MAX_VALUE ); | |
| System.out.println("short min : " + Short.MIN_VALUE + ", short max : " + Short.MAX_VALUE ); | |
| System.out.println("integer min : " + Integer.MIN_VALUE + ", integer max : " + Integer.MAX_VALUE ); | |
| System.out.println("long min : " + Long.MIN_VALUE + ", long max : " + Long.MAX_VALUE ); | |
| System.out.println("float min : " + Float.MIN_VALUE + ", float max : " + Float.MAX_VALUE ); | |
| System.out.println("double min : " + Double.MIN_VALUE + ", double max : " + Double.MAX_VALUE ); | |
| String stringNumber = "5"; | |
| String stringNumber2 = "5"; | |
| System.out.println(stringNumber + stringNumber2); | |
| int num1 = Integer.parseInt(stringNumber); | |
| int num2 = Integer.parseInt("6"); | |
| System.out.println(num1 + num2); | |
| // boxing | |
| Integer x = 5; | |
| Integer b = Integer.valueOf(5); | |
| // unboxing | |
| int d = b; | |
| d = b.intValue(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment