Skip to content

Instantly share code, notes, and snippets.

@minte9
Last active August 31, 2021 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minte9/1b99ec19b56200f62284f8d69ac0582e to your computer and use it in GitHub Desktop.
Save minte9/1b99ec19b56200f62284f8d69ac0582e to your computer and use it in GitHub Desktop.
/**
* Declare showInfo() method ...
* The method should display "Cooper is 3 age old" ...
* The method must have no return type
*/
class App {
public static void main(String[] args) {
Dog d = new Dog();
int age = 3;
String name = "Cooper";
d.showInfo(age, name); // Cooper is 3 age old
}
}
class Dog {
/**
* SOLUTION
*/
public static void showInfo(int age, String name) {
System.out.println(name + " is " + age + " old");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment