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 3 of 3

Thread: differnce between String class and Integer class

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

    Question differnce between String class and Integer class

    Hi.. I am Indrajeet Prajapati

    I am having doubt that what is the main difference between java String Class and java Integer Class in term of mutable and immutable


  2. #2
    Member
    Join Date
    Jun 2012
    Location
    Left Coast, USA
    Posts
    451
    My Mood
    Mellow
    Thanks
    1
    Thanked 97 Times in 88 Posts

    Default Re: differnce between String class and Integer class

    String objects are immutable.
    Integer objects are immutable.

    Period. Full stop.


    Cheers!

    Z

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

    Default Re: differnce between String class and Integer class

    Hi Indrajeet Prajapati,
    Both String and Integer classes are immutable(You might have noticed keyword "final" in the class definition). Immutable objects are nothing but their values cannot be changed. For example if you try to change the value of a string, you will get a completely new string object(Not that object gets modified).
    Hope i'm clear.

Similar Threads

  1. need to make basic class and implementation class (base class without void main)
    By javanewbie101 in forum Object Oriented Programming
    Replies: 1
    Last Post: September 19th, 2012, 08:03 PM
  2. Integer class
    By freakycoder in forum Collections and Generics
    Replies: 1
    Last Post: June 27th, 2012, 07:28 AM
  3. Replies: 3
    Last Post: June 17th, 2012, 06:22 PM
  4. Q about the String class
    By raabhim in forum Object Oriented Programming
    Replies: 4
    Last Post: March 23rd, 2012, 02:25 PM
  5. Question on String class
    By TP-Oreilly in forum Java Theory & Questions
    Replies: 8
    Last Post: September 25th, 2011, 08:12 PM