CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
What do you mean by static methods?
Category Java Interview Questions
Rating (3.4) By 8 users
Added on 10/13/2004
Views 1555
Rate it!
Answers:

By using the static method there is no need creating an object of that class to use that method. We can directly call that method on that class. For example, say class A has
static function f(), then we can call f() function as A.f(). There is no need of creating an object of class A.



Static method is act as something like global method thogh it is class member method since it defines during preprocessing.
So, static methods can be called without creating objects.(object.static method is not requred) class::static method can be used to call static methods



Posted by: Niranjan Ambati    

Contact Niranjan Ambati Contact Niranjan Ambati

The purpose of using static member is to create a copy of the method or a variable per class. not an every object for that class. So static means A copy per Class.



Posted by: Siva K    

Contact Siva K Contact Siva K

static methods are those which exist at compile time.Means the binding of code takes place at compile time so when we have to call this methods there is no need of object as instance method do.. thus static method can be called through class name only..
B.f();



Posted by: Upasana Pardeshi    

Contact Upasana Pardeshi Contact Upasana Pardeshi

Static methods update the function which is similar to all objects because class calls function.Static function access only static data



Posted by: ramesh    

Contact ramesh Contact ramesh

static members are used for sharing purpose.each object of other classes contains the same copy.



Posted by: avnish kumar,miet    

Contact avnish kumar,miet Contact avnish kumar,miet

If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    What do you mean by virtual methods?
    View Answer
    Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3
    and at freshman level.
    View Answer
    What are the disadvantages of using threads?
    View Answer
    Write the Java code to declare any constant (say gravitational constant) and to get its value.
    View Answer
    What do you mean by multiple inheritance in C++ ?
    View Answer
    Can you write Java code for declaration of multiple inheritance in Java ?
    View Answer
    What are the Object and Class classes used for?
    View Answer
    What is Serialization and deserialization?
    View Answer
    What interface must an object implement before it can be written to a stream as an object?
    View Answer
    What is the ResourceBundle class?
    View Answer

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:

    View ALL Java Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions
    Page URL: http://www.coolinterview.com/interview/372/default.asp?cachecommand=bypass


    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

    2.41
    Cache = 0.015625 Seconds