answersLogoWhite

0

What are the data types in java?

Updated: 11/22/2022
User Avatar

Wiki User

13y ago

Best Answer

There are two types of variables in Java:

• Primitives - 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.

• Reference variables - A reference variable is used to refer to (or access) an object. A reference variable is declared to be of a specific type and that type can never be changed.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the data types in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

Is built-in data-type are abstract data-types in java?

All built-in data types are not abstract data types.


Does java supports unsigned data types?

No, in Java, only signed numbers are defined.


What is the hierarchy of the java program?

define the data types


Variables as object in java?

There are two main categories of variables in Java. They are primitive and non primitive. Primitive data types are the basic data types like int, float, char etc. These are not objects. The other non primitive data types are all types of Java Objects. Example: String, ArrayList etc.


Why java called as strong type language?

That means that Java is fairly strict about data types.


How many simple data types are there?

There are a total of 8 simple or primitive data types in Java. They are:byteshortintfloatdoublebooleanlong andString


Is Java a true object oriented language?

since Java have primitive data types, I think its not pure OO


What are the only types in Java that are not classes?

The non-class Java data types are primitives: * byte * short * int * long * float * double * boolean * char


Does long int and long double data types are used in java as in c?

There is does a 'long' datatype in java, but no 'long double'.


Java variable types and controls?

Java is a powerful language that gives us options to have data in different forms. We have several data types that we can use for our needs. The basic data types that java offers us are termed as Primitive Data Types. Though all programming languages have varied data types java offers us with a variety of data types that are much powerful and simplified to use when compared to other languages.The Java programming language is strongly-typed, which means that all variables must first be declared before they can be used. This involves stating the variable's type and name.int age = 10;The above statement tells the java compiler that a field named "age" which holds numeric data and having an initial value of 10 is declared. A variable's data type determines the values it may contain, plus the operations that may be performed on it. In addition to int, the Java programming language supports seven other primitive data types. A primitive type is predefined by the language and is named by a reserved keyword. Primitive values do not share state with other primitive values. The eight primitive data types supported by the Java programming language are:byte, short, int, long, float, double, char and boolean


Why java is not purely object oriented programming language?

Java IS a pure OOP language. All types, including the built-in types, are implemented as objects.


What are the Different types of data type?

Java Data TypesJava is a powerful language that gives us options to have data in different forms. We have several data types that we can use for our needs. The basic data types that java offers us are termed as Primitive Data Types. Though all programming languages have varied data types java offers us with a variety of data types that are much powerful and simplified to use when compared to other languages.The Java programming language is strongly-typed, which means that all variables must first be declared before they can be used. This involves stating the variable's type and name.int age = 10;The above statement tells the java compiler that a field named "age" which holds numeric data and having an initial value of 10 is declared. A variable's data type determines the values it may contain, plus the operations that may be performed on it. In addition to int, the Java programming language supports seven other primitive data types. A primitive type is predefined by the language and is named by a reserved keyword. Primitive values do not share state with other primitive values. The eight primitive data types supported by the Java programming language are: byte, short, int, float, double, long, char and boolean