Check out example codes for "MaiorMenorDeDous java". It will help you in understanding the concepts better.

Code Example 1

import java.util.Scanner;

public class MaiorMenorDeDous {

	public static void main(String[] args) {
		Scanner teclado = new Scanner(System.in);
		
		//D
		
		int num1 = 0;
		int num2 = 0;
		
		//E
		
		System.out.println("introduzca numero1: ");
			num1 = teclado.nextInt();
		System.out.println("introduzca numero2: ");
			num2 = teclado.nextInt();
		
		//P
		
		if (num1 > num2 ) {
			System.out.println(num1 + " es el mayor");
		} else if (num2 > num1) {
			System.out.println(num2 + "es el mayor");
		} else {
			System.out.println("Error");
		}
		
		//S
	}

}

Learn ReactJs, React Native from akashmittal.com