What is the difference between static and non-static
variables?

Answer Posted / ravikiran

static variables are class variables and the values remains
same fr the whole class
nonstatic variables are of two kinds
global variables:are the variables which defines variables
which can be accesible over the whole class
local variables:the scope of local variables is with tin
the method only

Is This Answer Correct ?    29 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the most important feature of java? What is an interface?

607


What are the three parts of a lambda expression? What is the type of lambda expression?

676


Explain the transient field modifier?

655


Is it necessary that each try block must be followed by a catch block?

660


What is a stack class in java ?

707






What is difference between jdk,jre and jvm?

663


How many types of memory areas are allocated by JVM in java?

679


What do you understand by abstract classes?

708


What is supplier in java?

647


What is rmi and steps involved in developing an rmi object?

672


What is keyword and identifier?

740


What is the use of optional ?

663


What are the access modifiers available in java?

685


Why collection is called framework in java?

625


What is mvc in java?

651