摘要: public class EmployeeDemo { //方法一: public int search(String str,String strRes) {//查找字符串里与指定字符串相同的个数 int n=0;//计数器 // for(int i = 0;i<str.length();i++) { // // } while(str.indexOf(strRes)!=... 阅读全文
posted @ 2018-02-04 16:19 biubiubiuo 阅读(13406) 评论(1) 推荐(0) 编辑
摘要: String a = "abc";String b = "abc";a==b ;//返回true,因为a,b指向的是同一个地址 String a = new String("abc");String b = new String("abc");a==b;//返回false,因为a,b指向的不是同一个 阅读全文
posted @ 2018-02-03 21:28 biubiubiuo 阅读(263) 评论(0) 推荐(0) 编辑
摘要: public class Dog { public void Age(int age) {//副本新建的age age++;//对副本修改 System.out.println(age); } public void arrDemo(int[] arr) { arr[2] = 100;//对堆里的数据修改 for(int i =0;i<arr.length;i++) {... 阅读全文
posted @ 2018-02-03 19:59 biubiubiuo 阅读(783) 评论(0) 推荐(0) 编辑
摘要: public class Array2Demo2_3 { public static void main(String[] args) { //定义初始化 int[][] arr = new int[3][];//定义高维数组 arr[0] = new int[2];//高位数组下定义低维数组 arr[1... 阅读全文
posted @ 2018-02-03 17:37 biubiubiuo 阅读(173) 评论(0) 推荐(0) 编辑
摘要: import java.util.Arrays; public class ArrayDemo2_3 { public static void main(String []args) { // 冒泡排序 int[] num1 = new int[]{2,6,7,9,8,3,1,10}; for(in 阅读全文
posted @ 2018-02-03 14:27 biubiubiuo 阅读(237) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class ArrayDemo { public static void main(String []args) { // //线性查找 int [] num ={10,20,30,40,50}; Scanner input1 = n 阅读全文
posted @ 2018-02-02 23:12 biubiubiuo 阅读(281) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class perpetualCalendar { public static void main(String[] args) { // TODO Auto-generated method stub int year;//年 in 阅读全文
posted @ 2018-02-01 21:17 biubiubiuo 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 1.进制转换由低到高:byte<short(char)<int<long<float<double 2.java八种基本数据类型(存在栈里): 整数类型 byte,short,int,long, 浮点类型 float,double 字符类型 char 布尔类型boolean true,false S 阅读全文
posted @ 2018-02-01 21:01 biubiubiuo 阅读(111) 评论(0) 推荐(0) 编辑