面试题
heiha12343
这个作者很懒,什么都没留下…
展开
-
001螺旋矩阵的java实现
public class luoxuanjuzhen { public static void main(String[] args) { int n = 4; int m = 6; int[][] data = new int[n][m]; int dire; //当前数字的移动方向 final int UP = 0; //上转载 2013-07-09 13:48:22 · 707 阅读 · 0 评论 -
002&和&&的区别
&和&&都可以用作逻辑与的运算符,表示逻辑与(and),当运算符两边的表达式的结果都为true时,整个运算结果才为true,否则,只要有一方为false,则结果为false。&&还具有短路的功能,即如果第一个表达式为false,则不再计算第二个表达式,例如,对于if(str != null && !str.equals(“”))表达式,当str为null时,后面的表达式不会执行,所以不会出原创 2013-07-09 21:48:51 · 483 阅读 · 0 评论 -
003javase中的一些模糊的知识点
public class Temp { String str = new String("good"); char[] ch = {'a','b','c'}; public static void main(String[] args) { Temp temp = new Temp(); temp.change(temp.str,temp.ch); System.原创 2013-07-10 20:13:17 · 434 阅读 · 0 评论 -
005 str.charAt(int) str.indexOf(String)
public class Temp{ public static void main(String[] args) { String str = "hello,world"; //The method charAt(int) in the type String is not applicable for the arguments (String)// System.out原创 2013-07-10 21:34:49 · 623 阅读 · 0 评论 -
004内存回收的问题
/* *java内存回收的说法: *1.内存回收程序负责回收无用的内存 *正确 *2.内存回收程序允许程序员直接释放内存 *没有直接的枪支垃圾回收方法 *System.gc();也是调用垃圾回收机制 *3.内存回收程序可以在指定的时间内释放内存对象 * 只能在程序运行期间,虚拟机空闲的时候进行垃圾的回收 */原创 2013-07-10 21:14:24 · 620 阅读 · 0 评论 -
007关于静态方法的代码分析问题
package cn.hew.demo01;public class Person { static int arr[] = new int[10];// 输出为0// int arr[] = new int[10]; //编译时报错 /** * @param args */ public static void main(String[] args)原创 2013-07-12 00:26:18 · 487 阅读 · 0 评论