Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Wayne Crawford   on Oct 23 In Java Category.

  
Question Answered By: Adaulfo Fischer   on Oct 23

Hey buddy, I don't have much time, but here are some things I noticed. You
should also move the main method to a different class.

public void  PrintList()
{
//Passenger p1 = new Passenger;
//p1.printList();

System.out.println("My name  is" + name);
System.out.println("My address  is" + address);
System.out.println("My age  is" + age);
}
public static  void main(String[] args)
{
//Traveller[] travellerlist = new Traveller[3];
Passenger[] travellerlist = new Passenger[3];

travellerlist[0] = ("Jim","London","48");
travellerlist[1] = ("Sue","Manchester","22");
travellerlist[2] = ("Matt","Bristol","31");

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on array display class Or get search suggestion and latest updates.


Tagged: