Explain primitive data types in java, JAVA Programming

Assignment Help:

Explain primitive data types in java?

Java's primitive data types are extremely similar to those of C. They involve boolean, byte, short, long, int, float, double, and char. The boolean type has been added. Therefore the implementation of the data types has been substantially cleaned up in various ways.

1. Where C and C++ go away a number of issues to be machine and compiler dependent (for instance the size of an int) Java specifies everything.
2. Java prevents casting among arbitrary variables. Only casts among numeric variables and among sub and superclasses of the same object are permitted.
3. All numeric variables in Java are signed.

sizeof isn't essential in Java because all sizes are precisely described. For instance, an int is always 4 bytes. This might not seem to be adequate while dealing with objects in which aren't base data types. Therefore even if you did know the size of a particular object, you couldn't do anything with it anyway. You cannot convert an arbitrary object within bytes and back again.


Related Discussions:- Explain primitive data types in java

What can an applet do, What Can an Applet Do? An applet can: • Draw ...

What Can an Applet Do? An applet can: • Draw pictures on a web page • Create a new window and draw in it. • Play sounds. • Receive input from the user by the keyboard or

Describe the java.lang package, Describe the java.lang package ? Each p...

Describe the java.lang package ? Each package describes a number of classes, exceptions, interfaces, and errors. For instance, in Java 1.1 the java.lang package holds these:

N-th padovan string p(n), write a program that count the number of occurenc...

write a program that count the number of occurences of string in the n-th padovan string p(n)   program in java // aakash , suraj , prem sasi kumar kamaraj college progr

Why use rmi when we can handle the same benefits from ejb?, EJBs are distri...

EJBs are distributed elements, which need the RMI framework for object distribution. An EJB application server gives more services like object pooling, transaction management, data

Arrays, Prompt the user for an int between an upper and lower boundary. Reu...

Prompt the user for an int between an upper and lower boundary. Reuse the validateInput() method from project 2 to validate if the input is in bounds. If it is not, print an error

Garbage collection model, This assignment is about experimenting with the J...

This assignment is about experimenting with the Java runtime system's garbage collection model, and comparing it with the C++ manual memory allocation model. Below is the Garbage J

Polymorphism, Polymorphism - defines the ability of a single variable of ...

Polymorphism - defines the ability of a single variable of a provided type to be used to reference objects of different types, and automatically call the method that is specific

Generating Dynamic form, I am having an combox box and values are retrieved...

I am having an combox box and values are retrieved from the database having inputs and labels i want to created the dynamic form accroding to user input on combox box values

What is mvc, Model-View-Controller (MVC) is a design pattern put together t...

Model-View-Controller (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. ? Model: The model having the core of

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd