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...
Type: Posts; User: xJavaLover
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...
I added this
public String toString()
{
if (shipment == null)
return "shipment is null";
else{
String s = "ALL PACKETS \n";
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...
what will I be printing in...string s, int id, double d? in the array loop?
for(Packet mypacket : shipment)
It says, java.lang.NullPointerException
at Packages.toString(Packages.java:78)
at java.lang.String.valueOf(String.java:2854)
at...
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)
...