early binding و late binding در جاوا

early binding و late binding در جاوا به ترتیب معادل static Polymorphism و dynamic polymorphism هستند.

کلمه کلیدی final در جاوا

  • final is another keyword can be used in 3 different ways: 1-before a variable, 2-before a method, 3-before a class
  • if it is used before a variable, no one can modify it. that variable changes to a constant. eample; final int x = 100;
  • if it is used before a method no one can override the method. overloading is possible but overriding is not possible
  • if final keyword used before a class that class can not be extend


دستور پیش فرض در Constructor کلاس در جاوا

  • super keyword is a default statement inside a constructor, this keyword must be the first statement inside the constructor and can not be second or ..
  • If we are not writing any statement inside the constructor, java compiler will add the default statement to the constructor.

تفاوت Method Overloading و Method Overriding در جاوا

  • method overloading is creating more than one method with same name but different signature. It is used to achieve static poly morphisim.
  • method overriding is writing more than one method with same name and same signature in super class and sub class to acheive dynamic polymorophisim.


تفاوت this و super در جاوا

super points to the immediate Super class Object whereas this keyword points to the same object.