We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Introduction
- Java Datatypes
- Discussions
Java Datatypes
Java Datatypes
Sort by
recency
|
1468 Discussions
|
Please Login in order to post a comment
import java.util.; import java.io.;
class Solution{ public static void main(String []argh) {
} }
JAVA provides constants for relational comparison operations in their respective wrapper classes (Byte, Short, Integer, and Long)
To get minimum and maximum values use -->
byte: Byte.MIN_VALUE and Byte.MAX_VALUE short: Short.MIN_VALUE and Short.MAX_VALUE int: Integer.MIN_VALUE and Integer.MAX_VALUE long: Long.MIN_VALUE and Long.MAX_VALUE
You can use these constants in conditional statements to ensure that the values you are working with fall within the range of each data type.
This helps you to write clean code and also avoids the need to directly write large numbers for comparisons
Scanner sc = new Scanner(System.in); int t=sc.nextInt();
import java.util.; import java.io.;
class Solution{ public static void main(String []argh) {
}