Results 1 to 3 of 3
  1. #1
    esolve is offline Member
    Join Date
    Mar 2015
    Rep Power

    Default override/hide a final method in super class.

    Java Code:
    class Father(){
        final void func(){..} 
    Java Code:
    class Son extends Father(){
        void func(){
    my question is:
    1) since func() in the class Father is final, it can't be override, is it correct in grammar for us to define the void func() in the Son class?
    2) if so, is this called hide?


  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: override/hide a final method in super class.

    I don't understand why you are asking that question. You took the time to type in the
    code so why didn't you just type it in a file and try it out and see? They you can ask questions
    about anything you don't understand.

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: override/hide a final method in super class.

    Closing this one as it's a duplicate,
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 10
    Last Post: 01-09-2012, 08:57 PM
  2. Replies: 1
    Last Post: 10-17-2011, 01:00 AM
  3. problem in set & get method of a super class
    By elenora in forum Advanced Java
    Replies: 5
    Last Post: 04-22-2011, 01:42 PM
  4. Replies: 5
    Last Post: 01-26-2011, 06:38 PM
  5. Override class method
    By Mekie in forum New To Java
    Replies: 8
    Last Post: 11-01-2010, 06:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts