Question

Write a program in JAVA that prints the bounds ( maximum and minimum values) for all...

Write a program in JAVA that prints the bounds ( maximum and minimum values) for all integer data types in Java.

Homework Answers

Answer #1
public class Ranges {

    public static void main(String[] args) {
        System.out.println("Range of byte: " + Byte.MIN_VALUE + " to " + Byte.MAX_VALUE);
        System.out.println("Range of short: " + Short.MIN_VALUE + " to " + Short.MAX_VALUE);
        System.out.println("Range of int: " + Integer.MIN_VALUE + " to " + Integer.MAX_VALUE);
        System.out.println("Range of long: " + Long.MIN_VALUE + " to " + Long.MAX_VALUE);
    }
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
iNTRODUCTION TO JAVA PROGRAMING Write a program that prints a triangle using star (*) maximum star...
iNTRODUCTION TO JAVA PROGRAMING Write a program that prints a triangle using star (*) maximum star (10) Program output ********** ********* ******** ******* ****** ***** **** *** ** *
Write a program that takes a positive integer argument N, and prints out the average, minimum,...
Write a program that takes a positive integer argument N, and prints out the average, minimum, and maximum (in that order) of N uniform random numbers that it generates. Note that all three statistics should be over the same sequence of N random numbers.
ONLY ACCEPTING AS A TEXT FILE. Write a program (java) that determines the value of the...
ONLY ACCEPTING AS A TEXT FILE. Write a program (java) that determines the value of the coins in a jar and prints the total in dollars and cents. Read integer values that represent the number of quarters, dimes,nickels. and pennies.
In java : Write a program that will provide important statistics for the grades in a...
In java : Write a program that will provide important statistics for the grades in a class. The program will utilize a for-loop to read ten floating-point grades from user input. Include code to prevent an endless loop. Ask the user to enter the values, then print the following data: Average Maximum Minimum
write a program that prints all palindromic numbers between 0-9999 into the screen. Note :The code...
write a program that prints all palindromic numbers between 0-9999 into the screen. Note :The code should be written in java language.
JAVA CODE Write a program which has a 3D array and prints the integers from the...
JAVA CODE Write a program which has a 3D array and prints the integers from the array. Then then convert the output into a file using filewriter
Write a Java program that calculates and prints the monthly pay for an employee. The net...
Write a Java program that calculates and prints the monthly pay for an employee. The net pay is calculated after taking the following deductions: Withholding Tax 10% SSS Contribution 2.50% Medicare 1.30% PensionPlan PHP 200.00
in .java Write a program that asks the user to enter 3 grades and computes the...
in .java Write a program that asks the user to enter 3 grades and computes the minimum and the maximum of those 3 grades and prints it. Hint: Use the Math.min() and Math.max() methods. This program will compute the smallest and highest of 3 grades entered by the user. Enter 3 grades separated by a space: 100 85.3 90.5 Smallest: 85.3 Highest: 100.0 Bye
Write a Java program to randomly create an array of 50 double values. Prompt the user...
Write a Java program to randomly create an array of 50 double values. Prompt the user to enter an index and prints the corresponding array value. Include exception handling that prevents the program from terminating if an out of range index is entered by the user. (HINT: The exception thrown will be ArrayIndexOutOfBounds)
Using for loops: - write a Java program that adds numbers between 1 to 100 and...
Using for loops: - write a Java program that adds numbers between 1 to 100 and prints the result. - write a Java program that adds odd numbers between 1 to 100 and prints the result - write a Java program that averages even numbers between 5 to 30 and prints the result