1class App {
2 public static void main(String[] args) {
3 // The boolean keyword is for creating a variable with boolean data type.
4 boolean result = true;
5 System.out.println(result);
6 }
7}
1 javaCopypublic class booleanMethod {
2
3 public static boolean isEven(int mynumber)
4 {
5 return (mynumber % 2 == 0);
6 }
7
8 public static void main(String[] args)
9 {
10 int mynumber = 130;
11 if(isEven(mynumber) == true)
12 System.out.print("Even Number");
13 else
14 System.out.print("Odd Number");
15 }
16}
17