摘要: // 1,首先要实现Cloneable接口class Users implements Cloneable{ private int userId; private String userName; private int userAge; Users(int userId, String userName, int userAge) { this.userId = userId; this.userName = userName; this.userAge = userAge; } Users() { } ... 阅读全文
posted @ 2014-02-25 09:00 小菜喵 阅读(235) 评论(0) 推荐(0) 编辑
摘要: class User { private int user_id; private String user_name; private int user_age; public User(int user_id, String user_name, int user_age) { this.user_id = user_id; this.user_name = user_name; this.user_age = user_age; } public User() { } public int getUs... 阅读全文
posted @ 2014-02-24 10:53 小菜喵 阅读(1364) 评论(0) 推荐(0) 编辑
摘要: static int[][] seq_int = { {2349,12,420,549,120,3,23}, {1,30,84,693,29,4,4}, {7,239,943,82,32,492}, {2,4,234,5920,2019,40234}, {5,603,582,6928,923752,234}, {9,509,2392,95,102,402,2} }; public static void main(String[] args) ... 阅读全文
posted @ 2014-02-21 21:55 小菜喵 阅读(147) 评论(0) 推荐(0) 编辑
摘要: class Scope{ private int x; public int getX() { return x; } public void setX(int x) { this.x = x * 3; }}public class ScopeTest extends Scope{ public static void main(String[] args) { int a = 100; Scope se = new Scope(); se.setX(a); System.o... 阅读全文
posted @ 2014-02-21 16:17 小菜喵 阅读(118) 评论(0) 推荐(0) 编辑
摘要: class Employee { private int emp_id; private String emp_name; private float emp_salary; Employee() { } public Employee(int emp_id, String emp_name, float emp_salary) { this.emp_id = emp_id; this.emp_name = emp_name; this.emp_salary = emp_salary; } public ... 阅读全文
posted @ 2014-02-20 14:57 小菜喵 阅读(930) 评论(0) 推荐(0) 编辑
摘要: class Employee { private int emp_id; private String emp_name; private float emp_salary; public Employee(int emp_id, String emp_name, float emp_salary) { this.emp_id = emp_id; this.emp_name = emp_name; this.emp_salary = emp_salary; } public String toString() { ... 阅读全文
posted @ 2014-02-20 14:11 小菜喵 阅读(478) 评论(0) 推荐(0) 编辑
摘要: //二维数组排序 int[][] seq_int = { {1,342,54,24,545}, {4,5433,75,53,775}, {2,62,73,7445,673}, {6,90,954,193,2012} }; for(int[] row : seq_int){ Arrays.sort(row); } for (int i=0; i<seq_int.length... 阅读全文
posted @ 2014-02-20 13:24 小菜喵 阅读(151) 评论(0) 推荐(0) 编辑
摘要: int[] myAry = {0,1,3,4,6,87,3,2,4,34,34,7,45}; int[] myAry2 = myAry; int[] myAry3 = Arrays.copyOf(myAry, myAry.length); if(myAry == myAry2){ System.out.println("myAry 和 myAry2 相等"); }else{ System.out.println("myAry 和 myAry2 不相等"); } ... 阅读全文
posted @ 2014-02-20 10:28 小菜喵 阅读(192) 评论(0) 推荐(0) 编辑
摘要: //二维数组排序 int[][] seq_int = { {1,342,54,24,545}, {4,5433,75,53,775}, {2,62,73,7445,673}, {6,90,954,193,2012} }; for(int[] row : seq_int){ Arrays.sort(row); } System.out.println(Arrays.dee... 阅读全文
posted @ 2014-02-20 10:25 小菜喵 阅读(160) 评论(0) 推荐(0) 编辑