- 博客(13)
- 收藏
- 关注
原创 for语句
public class ForStatement { static boolean foo(char c) { System.out.print(c); return true; } public static void main( String[] argv ) { int i = 0;/*fo
2016-05-03 11:12:08
691
原创 短路与非短路运算符
根据下面的代码,String s = null;会抛出NullPointerException异常的有()。if( (s!=null) & (s.length()>0) )if( (s!=null) && (s.length()>0) )if( (s==null) | (s.length()==0) )if( (s==null) || (s.
2016-05-03 10:34:31
989
原创 Try、catch和finally
public class TryCatchFinally { public static String output =""; public static void foo(int i){ try{ System.out.println("try"); if(i == 1){ throw
2016-05-03 09:33:17
369
原创 将ISO8859-1字符串转成GB2312编码
public String(byte bytes[], Charset charset)函数可以用指定字节数组和编码来构造字符串。public byte[] getBytes(Charset charset)函数把字符串按指定编码来得到字节数组。可以用这两个函数来实现编码转:new String(String.getBytes("ISO8859-1"),GB2312);
2016-05-03 09:30:34
3176
原创 引用类型和基类型
class Test{ long width; public Test(long l) { width = l; } public static void main(String[] args) { Test a, b, c; a = new Test(42L); b = new Test(42
2016-05-02 16:03:53
866
原创 String类中split方法的使用
String类中split方法的使用split 方法:将一个字符串分割为子字符串,然后将结果作为字符串数组返回。
2016-04-10 09:59:55
830
原创 install torch7 on centos6.5
install torch7 on centos6.5+cuda6.5step1:setting system environment for installing torch and itorchstep2:installing torch on centos step3: installing itorch on centosstep4: installing matio
2016-03-30 10:09:18
3370
原创 String常用的方法
String常用的方法Contents:1. length()2. substring()3. toCharArray()4. charAt()5. indexOf()
2016-03-03 21:04:10
370
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人