java - 我有一个错误说,标记上的语法错误,删除这些标记等等,你可以自己看看
问题描述
它在行上说 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!!”);
}
}
解决方案
推荐阅读
- javascript - 过早调用 JQuery 点击监听器
- html - 为什么 !important 在我的代码中的 CSS 中不起作用
- php - PHP - 如果回显 $_GET['q']; 空添加此文本
- java - 如何使用wildfly为javax websockets设置自定义路径
- azure - API 管理 URL 给出缺少订阅密钥问题
- r - 将 R 中二项式 glm 的 cbind() 格式转换为具有单独行的数据帧
- python - 在对象列表中的所有对象上调用方法的惯用方式 Python 3
- ms-access - Microsoft Access 创建查找 10 到 11 个月前记录的查询
- c++ - const 限定符和前向引用
- html - 透明边框图像翻转底层背景颜色的渐变?