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

Thread: Returning location instead of value?

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Returning location instead of value?

    figured it out thanks for your help
    Last edited by cpguy; May 22nd, 2012 at 07:08 PM.


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Returning location instead of value?

    When you use != or == on reference types, you're comparing them to see if they refer to the same, single object. You'll have to override java.lang.Object.equals(Object) in your Fraction class.

Similar Threads

  1. How to find location of ipaddress using Java
    By tej in forum Java Networking
    Replies: 8
    Last Post: September 8th, 2012, 06:05 AM
  2. Open location from JList
    By hexwind in forum AWT / Java Swing
    Replies: 13
    Last Post: August 21st, 2011, 08:46 PM
  3. [SOLVED] How to specify FileOutputStream location?
    By Hallowed in forum Java Theory & Questions
    Replies: 7
    Last Post: May 29th, 2011, 06:36 PM
  4. Image location on a Runnable JAR file?
    By DarrenReeder in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 11th, 2010, 07:59 AM
  5. [SOLVED] File Reading from the specified location
    By rajesh.mv in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: August 13th, 2009, 12:56 AM