What is static in java?

Untitled Forums Java Help What is static in java?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3793
    Aakanksha
    Participant

    What is static in java?

    #11528
    Aakanksha
    Participant

    Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. However, you can’t override a static method with a nonstatic method. In other words, you can’t change a static method into an instance method in a subclass

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.