5 Matching Annotations
  1. Oct 2022
    1. Method overriding is used for runtime polymorphism

      we can't override static method of this property

    1. String...args: It allows the method to accept zero or multiple arguments. There should be exactly three dots between String and array; otherwise, it gives an error.

      Simlar to String args[]

    2. JVM executes the static block, then it executes static methods, and then it creates the object needed by the program. Finally, it executes the instance methods.

      Inside class first Static block is excuted then Static method

    3. The program will compile, but not run, because JVM will not recognize the main() method. Remember JVM always looks for the main() method with a string type array as a parameter.

      With out String args[] in main().

    1. An object in Java is the physical as well as a logical entity, whereas, a class in Java is a logical entity only.

      Object exists but Class is just logical steps to make object. Class --> Blue print and Object ---> Car