Re: What is wrong with this?
Are you going to tell us the details of those errors or do you want us to guess?
kind regards,
Jos
Re: What is wrong with this?
Hi,
Your code on lines 9-14 should read Country.name and Country.continent.
PrintInfo on line 18 passes two arguments when the method signature on line 8 doesn't accept any.
Regards.
Re: What is wrong with this?
Quote:
Originally Posted by
MW130
When I run this code I get 7 errors. What am I doing wrong?
your code have a problem with this line
Code:
System.out.println(name.Argentina+continent.Argentina);
System.out.println(name.China+continent.China);
System.out.println(name.UnitedStates+continent.UnitedStates);
you don't call like this.. you call like this..
Code:
System.out.println(Argentina.name+Argentina.continent);
System.out.println(China.name+China.continent);
System.out.println(UnitedStates.name+UnitedStates.continent);
And also your main method have problem with parameters. So you call like this...
Code:
public static void main(String[] args){
Country callit = new Country("","");
callit.PrintInfo();
}
Re: What is wrong with this?
And variable names and methods are aways lower case!