Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Use of final keyword

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Use of final keyword

    What is the use of final keyword


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,607
    My Mood
    Hungover
    Thanks
    145
    Thanked 658 Times in 563 Posts

    Default Re: Use of final keyword

    What do you think? What did google tell you? What happened when you wrote a program to test your assumptions?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Use of final keyword

    final keyword is used to make an object immutable. For more info, google....

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,265
    Thanks
    56
    Thanked 2,372 Times in 2,343 Posts

    Default Re: Use of final keyword

    final keyword is used to make an object immutable
    No. It's the variable that can't be changed. There is no restriction on the object a variable refers to.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member psabbate's Avatar
    Join Date
    Aug 2012
    Posts
    20
    My Mood
    Amused
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Default Re: Use of final keyword

    Quote Originally Posted by prasanthnms View Post
    final keyword is used to make an object immutable. For more info, google....
    That's wrong, the final keyword means that you can't reassign the variable. In case of methods, means that you can't override it. In case of Classes, means that you can't extend it.
    Everyone wants to go to heaven ... but nobody wants to die

    Nissi Group, Servicios IT,
    Diseņo Web, Desarrollo de Software, SEO,
    LinkedIn

  6. #6

    Default Re: Use of final keyword

    Hi vilkas,

    You can find some good examples about final keyword here.

    Hope this helps.

Similar Threads

  1. Uses of throws keyword
    By vilkas in forum Exceptions
    Replies: 1
    Last Post: December 11th, 2012, 03:17 AM
  2. [SOLVED] The 'new' Keyword
    By TheSlowLearner in forum Object Oriented Programming
    Replies: 17
    Last Post: August 7th, 2012, 01:05 AM
  3. [SOLVED] Adding the "final" keyword makes difference, I'm confused with the sequence flow.
    By SmokyBrain in forum Object Oriented Programming
    Replies: 2
    Last Post: April 30th, 2012, 02:50 AM
  4. keyword Extends
    By chronoz13 in forum Object Oriented Programming
    Replies: 3
    Last Post: November 27th, 2009, 07:30 AM
  5. final class, final <variable> or <data member>
    By chronoz13 in forum Object Oriented Programming
    Replies: 9
    Last Post: September 20th, 2009, 09:19 AM