11
Does the IF function only work with Integers or does it also work with String? I was trying to create a program that would ask if you are sure you want to create the password. You can check the code below:
package com.programas.Verificacao2;
import java.util.Scanner;
public class VoceTemCertezaVerifi {
    public static void main(String[] args) {
     int campo1 = 0, campo2 = 0;
     int sim = 0, não = 0;
     String s = "sim";
    Scanner in = new Scanner(System.in);
      System.out.println("Digite Sua Senha:");
      campo1 = in.nextInt();
      System.out.println("Digite novamente sua senha:");
      campo2 = in.nextInt();
      System.out.println("Você tem certeza?");
      s = in.nextLine();
      if(s == sim) {System.out.println("Senha Criada.");}else{
          if(s == não) {System.out.println("Ação Cancelada");
      }
    }
}
}
I think it answers => http://answall.com/q/34562/91
– rray