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: Running one of the Oracle tutorials

  1. #1
    Member
    Join Date
    Dec 2013
    Posts
    51
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Running one of the Oracle tutorials

    I'm going through the Oracle tutorials at the moment and this one is just throwing up load's of error's in Eclipse.

    It's the objects tutorial and it's in three parts, I copy pasted the code into different classes in Eclipse, but there're lot's of errors.


    here's the program (you need all three of these:

    CreateObjectDemo

    Point

    Rectangle



    I was just wondering if anyone else got these errors when they tried them on their computers? I must be doing something wrong on the initial import stage, I'm not sure what though


  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    609
    My Mood
    Sleepy
    Thanks
    10
    Thanked 93 Times in 86 Posts

    Default Re: Running one of the Oracle tutorials

    Hi, the three classes are working fine for me, being all in one package. Make sure youre not referencing the java.awt.Point and Rectangle classes. This is one of the bad examples in the Oracle tutorials. Your own classes should never have the same name as a class in the JDK. Just rename Point to MyPoint and Rectangle to MyRectangle and change the references in CreateObjectDemo.

  3. #3
    Member
    Join Date
    Dec 2013
    Posts
    51
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: Running one of the Oracle tutorials

    Quote Originally Posted by PhHein View Post
    Hi, the three classes are working fine for me, being all in one package. Make sure youre not referencing the java.awt.Point and Rectangle classes. This is one of the bad examples in the Oracle tutorials. Your own classes should never have the same name as a class in the JDK. Just rename Point to MyPoint and Rectangle to MyRectangle and change the references in CreateObjectDemo.
    Ah cheers PhHein! Yeah that's amazingly poor for a tutorial, there's been a couple of occasion's going through the tutorial that they seem to have done something in a particularly bad way...

    Program's up and running now, nice one

  4. #4
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    609
    My Mood
    Sleepy
    Thanks
    10
    Thanked 93 Times in 86 Posts

    Default Re: Running one of the Oracle tutorials

    I'm glad it works. I've just filed an issue with Oracle about reusing class names in the tutorails We'll see what the reply is.

  5. #5
    Member
    Join Date
    Dec 2013
    Posts
    51
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: Running one of the Oracle tutorials

    Ah nice one PhHein

    Oracle : "Thank you for your input. Whist we process your response why not download a fantastic tool-bar to heighten your browsing experience"

  6. #6
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    609
    My Mood
    Sleepy
    Thanks
    10
    Thanked 93 Times in 86 Posts

    Default Re: Running one of the Oracle tutorials

    That might happen.

Similar Threads

  1. Replies: 1
    Last Post: August 5th, 2013, 02:49 PM
  2. Replies: 21
    Last Post: June 12th, 2013, 11:33 AM
  3. Oracle's answer to exercise 1 in Interfaces - Java Tutorials
    By MaXER in forum Object Oriented Programming
    Replies: 8
    Last Post: September 24th, 2012, 02:01 AM
  4. pseudocode tutorials
    By pascal in forum Java Theory & Questions
    Replies: 2
    Last Post: July 30th, 2012, 01:19 AM
  5. Java Tutorials and Help
    By theitranger in forum The Cafe
    Replies: 4
    Last Post: March 31st, 2011, 05:24 PM