'\n'是 Linux上的换行
'\r\n'才是Windows上的换行
试过了,是真的。。。
只需要把‘\’ 变成‘\\’即可
Java编写代码过程中遇到了一个问题,main方法中创建内部类的实例时,编译阶段出现错误,查看错误描述:
Multiple markers at this line
- The value of the local variable test is not used
- No enclosing instance of type StaticCallDynamic is accessible. Must qualify the allocation with an enclosing instance of type StaticCallDynamic (e.g...
public class passwordVerify {
public static void main(String[] args)
{
// TODO Auto-generated method stub
verify();
}
public static void verify()
{
String originalUserName = "cs1053283896@gmail.com" ; //账号密码信息
String originalUserPassword = "123456789" ;
Scanner myscanner = new...
public static void main(String[] args) {
// TODO Auto-generated method stub
String aString = "hellocensi @gmail.com " ;
System.out.println(aString);
int lenthString=aString.length();
System.out.println("way1:"+lenthString);//常用方法1:获取字符串长度
char str[]=aString.toCharArray(); //常用方法2 :...
public static void main(String[] args)
{
double sprt20=Math.sqrt(20);
sprt20=(float)Math.round(sprt20*10000)/10000.0; //关键:10^n,n表示小数点后位数,且后面的10^n须带一位小数点
System.out.print(sprt20);
}
结果:4.4721