Results 1 to 3 of 3
  1. #1
    javaplus is offline Member
    Join Date
    Nov 2007
    Posts
    97
    Rep Power
    0

    Default Method with final keyword

    I have following method (example).

    Java Code:
    	
    public  static final String getString(){
    		return "Welcome";
    	}
    What does final keyword represent here?
    I am able to call this and it works fine. How does final makes this special.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    The old tutorial had a section in it on "Final Methods" that appears to have been omitted in the new tutorial.
    Basically, it means that you cannot override the method.

  3. #3
    javaplus is offline Member
    Join Date
    Nov 2007
    Posts
    97
    Rep Power
    0

    Default

    Ok, so method definition is final and cannot be overridden.
    Thankyou hardwired.

Similar Threads

  1. Keyword : volatile
    By peiceonly in forum Advanced Java
    Replies: 13
    Last Post: 11-17-2010, 12:47 PM
  2. finalize keyword
    By bugger in forum New To Java
    Replies: 6
    Last Post: 10-01-2008, 12:28 PM
  3. Demonstration of the transient keyword
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 11:09 PM
  4. transient keyword
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-11-2007, 10:27 AM
  5. Use of this keyword
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-18-2007, 07:32 PM

Posting Permissions

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