Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is static variable and static method?

Answer Posted / monika watts

STATIC VARIABLE: static variable is that variable that is
shared by all the objects of a class.means allocates memory
once even if we create any no of objects and even if we
create no object.
STATIC METHOD: first thing about static method is that we
can access static variables only with in static method.
and static methods can be called without the object of that
class.
let
class a
{
static void hello()
{
System.out.println("hello friend");
}
}
now we can access this method as hello() or a.hello();
without any object or with class name.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which java ide is used the most?

946


What is a dynamic array java?

885


What is the association?

928


What is java volatile?

960


Explain purpose of sleep() method in java?

1058


What do you mean by jjs in java8?

943


What are packages in java?

1460


What do bitwise operators do?

952


Explain about fail safe iterators in java?

962


What is difference between float and double?

912


What is the difference between throw and throws in java?

1028


Why is it important to initialize a variable?

938


What is the difference between C++ and Java and your preferences?

1065


Which sorting algorithm is best in java?

935


What is formatted output?

897