File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

final methods

 
Hasitha Randika
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
--------------------------------------------------------------------------------
class A{
private final void method1(){
System.out.println("A");
}
class B extends A{
public final void method2(){
System.out.println("b");
}
}
class C{
public static void main(String ar[]){
new(B).method2();
}
}

here the answer is "b".can we override the final method in class A?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Note: If you notice, after posting, that you made a mistake, then you can edit your own post to correct it by clicking the button. You don't need to start a new post.

And please use code tags when you post code, so that the forum can display your code properly.

Continue in your other post.
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic