0
package question;
import java.util.Scanner;
public class quiz {
    public static int score = 0;
    public static void main(String args[]){-
        Scanner inp123 = new Scanner(System.in);

        String q1;

System.out.println("whats my name?");
        q1 = inp123.nextLine();
        if (q1=="matt"){
            System.out.print("Correct that is my name!");
        }else{
            System.out.println("Incorrect");
            score = score + 1;
            System.out.print("Your score is: ");
            System.out.println(score);
            quiz.main(args);
        }

Heres my code and when I input matt it says its incorrect new to java, if anyone can help me or be willing to teach me java reply or hit up my inbox, I have good experience in python and looking for a new language

0 Answers0