Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

doubt on final keyword

  Asked By: Bertha    Date: Jun 20    Category: Java    Views: 942
  

iam new to java. i have some confusion on final keyword.

this keyword is used to prevent method overloading.

but in thread, join() and isAlive() are declared as final.

eventhough it is final, these are used.

not in directly,

<threadObj>.t.join();
all the methods are directly acted on obj.

but here why, double dot.

if u know the explanation pls send it to me.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Dinh Tran     Answered On: Jun 20

i think if the final  keyword is used to prevent  method overriding.... not method
overloading..when a method  Adds in class Calc is declared final and class
Calculate extends Calc then it cannot define Adds method in the Calculate class
ie it cannot be overridden.... when a method is declared final then it cannot be
inherited....

 
Didn't find what you were looking for? Find more on doubt on final keyword Or get search suggestion and latest updates.




Tagged: