answersLogoWhite

0


Best Answer

1) List the eight basic data types used in Java. Give examples. The basic types are also known as primitive types and when a variable is declared as any of them, the computer creates what you can call a 'box' in its memory that is big enough to hold a value of that type. Eg int x; // at runtime, computer creates a box called 'x' big enough to hold an integer an integer can be anything between -2147483638 to 2147483647 the other seven primitive (or basic) data types are byte - anything between -128 to 127 short - anything between -32768 to 32767 long - anything between -9223372036854775808 to 9223372036854775807 float - anything between -1.4 * 10^-45 to 3.4 * 10^38 double - anything between -4.9 * 10^-324 to 1.8 * 10^308 char - any single digit on your keyboard (unicode) boolean - true or false source: charatan and kans Java in two semesters pg 19

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

Data types in Java represents the type of data a java object holds. There are different data types in Java. They are:

1. int, float, double, long, short etc - used to hold numbers

2. boolean - used to hold true or false values

3. Strings - used to hold a series of characters like names, address etc

4. char - used to hold single characters

Each primitive data type has a corresponding Wrapper class that can be used if we require the value in a primitive data type as an object.

for example Integer is the wrapper class for int

Example declarations:

int x = 10;

String name = "Tommy";

char sex = 'M';

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

basic data types:

Byte, short, int, long, float,

Double, char, boolean

advanced data types

array type

// Points to an array instance

class type

// Points to an object or a class instance

interface type

// Points to an object and a method, which is implemented to the corresponding interface

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Assuming by "fundamental" you mean the primitive data types: boolean, byte, char, short, int, long, float, and double

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Explain different data types in Java with example?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How java is different from c plus plus Explain with example?

See related links, below.


3rd sem model question papers from vtu?

(Affiliated to Osmania University) Khairatabad, Hyderabad First Term Examination B.Sc. 3 Year Web Technologies(c4) Time: 3 Hours Max. Marks: 100 SECTION-A Note: Answer any FIVE questions 5*8=40 1. Explain Text formatting tags of HTML. 2. Write a note on XML. 3. What is Form? Give a suitable example. 4. What is hyperlink? Explain with example. 5. Write about html tags for defining lists. 6. Explain cascade style sheets. 7. Write a note on Frames. 8. How to define tables using HTML tags. 9. Write a note on Java Script Variables. 10. Explain Extensible HTML? SECTION-B Answer any FIVE questions. 5*12=60 1. Explain how to add images and colors into a web page. 2. Discuss in detail Data types used in Java Script. 3. Explain different types of operators used in Java Script. 4. Explain different types of lists. 5. Explain Objects in Java Script. 6. Discuss in detail Events in Java Script. 7. What is String Manipulation in Java Script. 8. Write a HTML code for image as Hyperlink. 9. Write about Active Server Pages. 10. Explain different types of statements in Java Script.


What is the different types of language?

c, c++, java


What are the different types in java programming language?

core java ,jse.advanced jse,jee and j2me


In main memory how many bits num variable will hold?

That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.


What are the eight java operator?

The different types of operators in Java are:Assignment OperatorsRelational OperatorsArithmetic OperatorsLogical Operators


Explain three different methods in java?

There are three different methods /functions in java are there : 1)computational methods.2)manipulative methods.3)procedural methods.


What is JButton in java and explain it?

A JButton on Java is a button used for G.U.I (graphical user interface) and displays a button on a window created which can be programmed for different tasks.


What are the different types of relationships in java?

Following are the types: 1)Is a 2)Has a 3)Uses a 4)Own zip


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.


What happens when you perform arithmetic operations mixing different types of variables in java programming?

Java performs an implicit conversion to a unifying type.


Describe different types of java tools?

javac,rmic,eclipse,jbuilder etc..,