Lesson 3 - Running Methods of a Class You can also test and debug classes (that are not dependent on other classes) For Example import java.io.*; public class decision { public static void start() throws IOException {input in = new input(); System.out.println("Enter a number "); int n = in.getInt(); if (n % 2 == 0) System.out.println("It is even"); else System.out.println("It is odd"); } }
|