answersLogoWhite

0


Best Answer

A primitive variable can be one of eight types: char, boolean, byte, short, int, long, double, or float. Once a primitive has been declared, its primitive type can never change, although in most cases its value can change.

Primitive Data Type Ranges in JavaData TypeBits UsedMinimum ValueMaximum Valuebyte8-2727 - 1short16-215215 -1int32-231231 -1long64-263263 -1float32n/an/adouble64n/an/a

The range for these floating point numbers is difficult to determine. Booleans and char type variables do not have a range. Booleans can be either true or false and chars can be only one character in size Ex: "A" or "B" etc

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the eight Java primitives types and give it size?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does java give you a virus?

Java does not give a virus, but an applet or something that runs on java may give a virus. That is why sometimes it asks you if you trust a company or publisher when you run java.


Can you teach me java?

Yes I can teach you Java.... give your mail Id ...I will send you my details


Does java give your pc any viruses?

No.


How do you run a java program form the command prompt?

The command is "java", followed by the class name. For example, if your compiled class is called myclass.class, you give the command: java myclass


How do write searching number programme in java?

give description of that then i will send the answer


List the eight basic data types used in java and give examples?

The 8 primitive data types are byte, short, int, long, float, double, boolean and char boolean is used to store logical values true/false char is used to store single digit characters. 'Y', 'X' etc the remaining data types are used to store a wide variety of numbers.


Anyone can give you some big forum site about java tech?

Javaranch.com


Can you give the codes of the flag of Philippines using java applet?

System.out.println("No.");


Does downloading 'java' give you pop-ups?

It can give you popups only if you download the java from an unsafe site . Also have 1. Malwarebytes Anti-Malware 2. Superantispyware installed on your computer that you can scan and get rid of the virus immediately.


Give the structure of multiple inheritance?

Java does not support multiple inheritance. It is done with the help of interfaces in java. a class can implement n number of interfaces, thus showing multiple inheritance. but a class cannot extend multiple classes in java.


What is type safety in java?

Type safety is the degree to which the language prevents you from making typing errors. That is: assigning values of one type to variables of another type. For example, in Java: int i; String s = "Not an integer"; i = s; is a type error as you are trying to assign a value of type String to a variable of type int. Java is moderately type safe as it will allow you to "type-cast" (automatically convert types) for some combinations but will give a compiler error for others.


Use of valueOf function in java?

The valueOf functions are used in the Java wrapper classes to convert between types. Common uses are converting a number to a String or vice versa. You are encouraged to use these functions instead of creating a new object from a constructor because of the way Java caches values. A call to valueOf will give you the same result as creating a new object, but it may be more efficient if you're creating the same values multiple times.