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

Code Example 1

import java.util.Scanner;

public class ComprobaContrasinais {

	public static void main(String[] args) {
		Scanner teclado = new Scanner(System.in);
		
		//D
		
		String clave1;
		String clave2;
		String mensaje;
		
		//E
		
		System.out.println("Introduza contrasinal: ");
			clave1 = teclado.nextLine();
		
		System.out.println("Repita contrasinal: ");
			clave2 = teclado.nextLine();
		
		//P
		
		if (clave1.equals(clave2)) {
			mensaje = "As contrasinais coinciden";
		} else {
			mensaje = "As contrasinais NON coinciden.";
		}
		
		//S
		
		System.out.println(mensaje);
		
	}

}

Learn ReactJs, React Native from akashmittal.com