0

General Form of setPriority() method is

         final void setPriority(int level)

My question is whether setPriority() method can be used by a subclass extending Thread class since it cannot be overridden because final modifier is set to the method.I have been using setPriority() method in classes implementing Runnable Interface.Pardon me guys if my question is stupid I'm just curious

jmj
  • 237,923
  • 42
  • 401
  • 438

1 Answers1

4

Yes, it can be called freely by a subclass of Thread. The final keyword only prevents subclasses redefining it.

nanofarad
  • 40,330
  • 4
  • 86
  • 117
  • i am new to java can u be more specific coz overriding means subclass having the method with same type signature & name .so what is the difference if a subclass uses setPriority(int level).can u provide a example to make things more clearer to me..plz – sweet_revathy569 May 23 '14 at 18:00