User Profile

Collapse

Profile Sidebar

Collapse
ITQUEST
ITQUEST
Last Activity: Feb 23 '07, 12:37 AM
Joined: Feb 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ITQUEST
    replied to Inventory Java Project Help
    in Java
    I worked on it and got it to run! Thanks so much for your help!
    When I get to the next step of my assignment can I post any questions under this same thread or should I start a new one?

    ITQUEST...
    See more | Go to post

    Leave a comment:


  • ITQUEST
    replied to Inventory Java Project Help
    in Java
    I am not sure if I understand. I have changed the code in the beginning to look like this:

    // Product2 class

    import java.util.*;

    public static void main (String args[])
    Product2 p = new Product2();

    class Product2 implements Comparable {


    private String title; // class variable stores the item title
    private long number; // class variable stores...
    See more | Go to post

    Leave a comment:


  • ITQUEST
    replied to Inventory Java Project Help
    in Java
    Yes I believe so. I changed that part of the code to read as this:

    public int compareTo (Object o) {
    Product2 p = null;
    try {
    p = (Product2)o;
    }
    catch(ClassCast Exception cE) {
    cE.printStackTr ace();
    }
    return title.compareTo (p.getItemTitle ());
    }

    And tried to run it. It gives me the error: Exception in Thread "Main" java lang. NoSuchMethodErr or:...
    See more | Go to post

    Leave a comment:


  • ITQUEST
    replied to Inventory Java Project Help
    in Java
    Yes this is my latest version of Product2. I do not see a getItemName().. .where do you see that? I guess I have been working so long I am getting confused. Do you see the error in my posted code?

    Thanks for your help! ITQUEST...
    See more | Go to post

    Leave a comment:


  • ITQUEST
    started a topic Inventory Java Project Help
    in Java

    Inventory Java Project Help

    I am on the second step of my Inventory Project and can properly run my Inventory2.java file but not my Product2.java file. I get the following error: 71:cannot find symbol, symbol: method getItemTitle() location: class Product
    returntitle.com pareTo(p.getIte mTitle());
    ^

    Here is my code:
    Code:
    // Product2 class
    
    import java.util.*;
    
    class Product2 implements
    ...
    See more | Go to post
    Last edited by horace1; Feb 18 '07, 04:22 PM. Reason: added code tags

  • ITQUEST
    replied to .class vs. .java
    in Java
    Thanks to both of you for the explanations. They made sense to me and I was able to correctly complete my assignment because of this.


    Thanks Again!
    ITQUEST
    See more | Go to post

    Leave a comment:


  • ITQUEST
    started a topic .class vs. .java
    in Java

    .class vs. .java

    The moderator posted this in another thread:
    (I am starting a new one not to confuse the other subject at hand)

    ".java classes are compiled to into .class files. If you have a .java file called Product.java, when you compile it a .class is created for every class in the file Product.java if there are no errors. In this case you are getting this error because there is no class file called Product.class so you must compile...
    See more | Go to post

  • ITQUEST
    replied to Inventory program in Java
    in Java
    I run it and get the following error:

    NoClassDefFound Error: Product

    Any suggestions?...
    See more | Go to post

    Leave a comment:


  • ITQUEST
    replied to Inventory program in Java
    in Java
    Do you post the first half as your .java and the second as your .class to get it to run? I understand how you have it written. I can read the material and understand it when I see it, but putting the two together is the challenge for me.

    I have to say that all of the classes so far have been fine, but this one is bad. Do you mind me asking questions along the way or will you leave this forum after you complete the course?
    ...
    See more | Go to post

    Leave a comment:


  • ITQUEST
    replied to Inventory program in Java
    in Java
    Me again...
    I am also wondering how to set up a class. I get how to establish the Java file but the class thing has me confused. What is the difference? I guess I have just been getting by until now, but I can't seem to get it right!
    ITQUEST...
    See more | Go to post

    Leave a comment:


  • ITQUEST
    replied to Inventory program in Java
    in Java
    Stevedub,
    Looks like I am in the same class you are but only in Week 5. I am completely lost and the teacher is NO help!
    Can you offer any advice for the Wk 5 Checkpoint? It is the Inventory Program Part 1.

    ITQUEST...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...