关于在记事本写入"\n"不显示换行的原因

'\n'是 Linux上的换行 '\r\n'才是Windows上的换行 试过了,是真的。。。
2017-06-20 09:30 | 阅读 3697 次 | 评论 1 条

how to solve Invalid escape sequence(valid ones are \b \t \n \f \r \” \' \\ )" syntax error

只需要把‘\’ 变成‘\\’即可
2017-06-14 15:29 | 阅读 1580 次 | 评论 0 条

Java中No enclosing instance of type X is accessible报错

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...
2017-05-28 18:11 | 阅读 2417 次 | 评论 0 条

Java用户登录验证

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...
2017-05-28 13:44 | 阅读 1533 次 | 评论 0 条

Java字符串的常用方法

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 :...
2017-05-28 12:21 | 阅读 1723 次 | 评论 0 条

保留n位小数的方法

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
2017-05-23 13:12 | 阅读 1191 次 | 评论 0 条