How all can you instantiate final members

Showing Answers 1 - 11 of 11 Answers

Ashutosh Gupta

  • Jun 26th, 2005
 

Final member can be instantiate only at the time of declaration.null

  Was this answer useful?  Yes

Sisodiya Pramod

  • Aug 16th, 2005
 

we can instantiate the final members through block or directly at the time of declaration.

  Was this answer useful?  Yes

abhilash

  • Oct 14th, 2005
 

Final members cannot be instantiated

  Was this answer useful?  Yes

Devidas Sonawane

  • Oct 28th, 2005
 

We can't instantiates final member.

  Was this answer useful?  Yes

radhika

  • Jun 16th, 2006
 

Final memebers can be intialized but not instantiated. But final class can be instantiated.

  Was this answer useful?  Yes

avinashkt

  • Nov 27th, 2006
 

Final members can be instantiated either at the time of declaration

or

it can  be instantiated in the constuctor of the class.

for ex.

      class a {

      // public final int i = 3; or

         public final int i;

          a(int j){

            this.i =  j;

          }

      }

if you dont initialize it  will give compilation error.

Venkatesh

  • Jul 27th, 2007
 

The other way of instantiating final member is on method argument (Just in case we do not want the value to be changed within the method,

ex

void Check(final String a){
  
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions