Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
java methods please help?
Can someone please tell me why my program won't compile,If I take out the second(); method call from the main method it will work until I insert it again and it gives me errors,am i declaring the method wrong,please help I'm so confused
class ut{
public static void main(String[] args){
second();
}
public void first(){
second(20);
}
public void second(int age){
System.out.print(age);
}
}
@Jimmy I tried setting the age in the main method and still get the same result.
@brillian_moves,tried it no luck what so ever
2 Answers
- jimmyLv 47 years agoFavorite Answer
second() is expecting an int age input, while your main does not supply it.
- brilliant_movesLv 77 years ago
Try calling first() from main, instead of calling second().
Source(s): Experience