首页 > 解决方案 > 我有一个错误说,标记上的语法错误,删除这些标记等等,你可以自己看看

问题描述

它在行上说 String correctname="Pisay"; 语法错误删除此标记

package StringExple;

import java.util.Scanner; 

public class StringExple{ 
    public static void main(String[] args) { 
        Scanner sc = new Scanner(System.in); 
        String correctname=”Pisay"; 
        System.out.println(“Enter your username:”); 
        String username = sc.nextLine(); 
        if(username.equals(correctname)){ 
            System.out.println(“Authorized user!!”);
        } else
            System.out.println(“Unauthorized user!!”); 
        if(username.equalsIgnoreCase(correctname)) {
            System.out.println(“Authorized user!!”);
        } else 
            System.out.println(“Unauthorized user!!”);
    } 
}

标签: java

解决方案



推荐阅读