what are variables in java

Answer Posted / hemanta paudel

Every data are store in memory and that memory has literal
name that is called variable.There are two type of variable
in java
1. Local variable :- that variable which is declare in
method body or argument list called as local variable and
its are store in stack.
2. Instance Variable:-those variable which are declare
within a class and obtain the memory when the instance of
class is created. Each instance have own variable.

3. Static or class variable:- those variable which are
declare using static keyword and they are load in memory
when class is loaded.

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default size of load factor in hashing based collection?

665


What is prefix of a string?

683


What is thread pool? How can we create thread pool in java?

716


how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion... ANS:--- >executeupdate method is having boolean return type, if anything goes wrong in data insertion or data updation, it would return false. otherwise, if it successfully inserts data into the database, it would return true NOW HOW TO I CHECK IN MY DURING EXECUTION WHETHER IT RETURNS TRUE OR FALSE... WELL IT WILL DISPLAY ANY MESSAGE OR NOT

1932


Why are getters and setters used?

657






How can I debug the Java security exceptions and AccessControlExceptions?

757


Explain the difference between protected and default access.

628


what is recursion in java

681


what is the difference between Object Based Language and Object Oriented Language?

679


When to use runnable interface vs thread class in java?

614


What do you mean by default constructor in java?

669


What is difference between checked and unchecked exception in java?

659


What is java dot?

576


Which language is java?

635


What is public static?

587