answersLogoWhite

0


Best Answer

How a Java variable would act depends on the variable's data type. Variables of the primitive data types like int, char, float etc would not act as objects. But apart from them, all other data types would act as Objects. Almost all data types would extend from java.lang.Object and would behave as objects.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Java variables act as object or not?
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.


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.


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.