作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在这段代码上遇到了这个错误,我无法弄清楚哪里出了问题。
public class enc {
//The Look-Up Table with the position of all the available characters
public static final String LUT="*, .abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
Scanner sc=new Scanner(System.in);
System.out.print("Input the sentence you want to encode.");
String s= sc.nextLine();
}
最佳答案
您需要将代码放在一个方法中:
public class enc {
//The Look-Up Table with the position of all the available characters
public static final String LUT="*, .abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.print("Input the sentence you want to encode.");
String s= sc.nextLine();
}
}
关于java - System.out.print (""); token "."上的语法错误,@ 应在此 token 之后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26563939/
我是一名优秀的程序员,十分优秀!