- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the maximum possible value of an integer in Java ?
The MAX_VALUE is used to find the maximum possible value for an integer in Java. Let us see an example −
Example
public class Demo{ public static void main(String[] args){ System.out.println("The type is"); System.out.println(Integer.TYPE); System.out.println("The size is"); System.out.println(Integer.SIZE); System.out.println("The max value of integer is"); System.out.println(Integer.MAX_VALUE); } }
Output
The type is int The size is 32 The max value of integer is 2147483647
A class named Demo uses the Integer class and gives the various characteristics of the Integer class such as type, size and max_value. The maximum value that an integer can hold can be computed by calling the integer class with the MAX_VALUE value. It is displayed on the console.
Advertisements