Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package TC;
- import TC.Objects.Human;
- /**
- *
- * @author Connerd
- */
- public class Main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Main M = new Main(args);
- }
- public Main(String[] args) {
- Human Connor = new Human("Connor", 16); // Calls a new instance of
- // Human with the variables
- // "Connor" and 16.
- log(Connor.getName()); // Logs Connor's instance of "Human"'s Name
- Human Michael = new Human("Michael", 15);// Calls a new instance of
- // Human with the variables
- // "Michael" and 15.
- log(Michael.getAge()); // Logs Michael's instance of "Human"'s Age
- }
- public void log(String msg) {
- System.out.println(msg);
- }
- public void log(int msg) {
- System.out.println(msg);
- }
- }
Add Comment
Please, Sign In to add comment