کلمه کلیدی 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


نظرات 0 + ارسال نظر
برای نمایش آواتار خود در این وبلاگ در سایت Gravatar.com ثبت نام کنید. (راهنما)
ایمیل شما بعد از ثبت نمایش داده نخواهد شد