Search:

Type: Posts; User: xJavaLover

Search: Search took 0.08 seconds.

  1. Replies
    11
    Views
    1,476

    Re: Need some help getting this code to run...

    OK I figured it out...my array now prints the input file.

    BUT my methods (displayHeavyWeight, displayLightWeight...etc) are not being displayed or called I believe...how do I go about implementing...
  2. Replies
    11
    Views
    1,476

    Re: Need some help getting this code to run...

    I added this



    public String toString()
    {
    if (shipment == null)
    return "shipment is null";
    else{
    String s = "ALL PACKETS \n";
  3. Replies
    11
    Views
    1,476

    Re: Need some help getting this code to run...

    I got the code to compile and run but it only outputs "ALL PACKETS" text...I don't know what's going on.



    public class Packet extends Packages
    {
    // instance variables - replace the...
  4. Replies
    11
    Views
    1,476

    Re: Need some help getting this code to run...

    what will I be printing in...string s, int id, double d? in the array loop?
  5. Replies
    11
    Views
    1,476

    Re: Need some help getting this code to run...

    for(Packet mypacket : shipment)

    It says, java.lang.NullPointerException
    at Packages.toString(Packages.java:78)
    at java.lang.String.valueOf(String.java:2854)
    at...
  6. Replies
    11
    Views
    1,476

    Need some help getting this code to run...

    I compiled my code but it will not output. I get an error that points to



    public String toString()
    {
    String s= "ALL PACKETS \n";
    for(Packet mypacket : shipment)
    ...
Results 1 to 6 of 6