```
public void AmPm(int time) {
 if (time >= 12 && time < 12)
   System.out.println("AM");
 else if (time >= 12 && time < 24)
   System.out.println("PM");
 else
   System.out.println("invalid input");}

```

How can I call this method in the main method