answersLogoWhite

0

Variables as object in java

Updated: 11/19/2022
User Avatar

Wiki User

15y ago

Best Answer

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.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Variables as object in java
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where is the data representing the internal state of a Java object held?

Member variables.


What do you mean by this keyword in java?

"this" is a Java keyword that references the current object. Any part of the object(instance variables, methods, constructors) can be accessed by calling this.[member].


Can object extends?

objects are instances of class only and moreover objects are object reference variables extension of variables is meaningless so objects in java can't be extend


What are the differences between C and Java reference variables?

Java does not have the concept of Reference Variables. We cannot access the memory location where the data is stored in Java.


What are Instance variables java?

Instance variableA variable, part of an Object. These might better be called perObject variables since each instantiated object of this class will have its own private copy of this variable. They are allocated when the object is allocated via new. Static methods may not access the instance variables of their class (or any other class for that matter), other that via some object reference, e.g. anObject.someField. Static methods may even access private instance variables in their class via some object reference.


Does java consider the variables Hello and hello to be different variables?

no


Why there are no global variables in java?

Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:The global variables breaks the referential transparencyGlobal variables creates collisions in namespac


What is the syntax of global variable in java?

There's no global variables in Java.


How we can get address of variables in Java as pointer variables in C?

At any given point of time you cann't get the address of a variables of java program. This is meant for security purpose only.


In java all variables declared using a class are?

Reference variables


Are static variables serialized in java?

No, static variables are not serialized.


What is a java object?

A java object is a collection of methods and properties defined in the Java programming language.