• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






记录一生

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2017年5月9日

1.12 判断字符串第一次出现的位子 和 字符串是否存在
摘要: package Demo; public class Demo4 { public static void main(String[] args) { String str = "helloworld"; /*if(str.indexOf("hello")!=-1){ System.out.prin 阅读全文
posted @ 2017-05-09 23:43 记录一生 阅读(160) 评论(0) 推荐(0)
 
1.11 字符串截取
摘要: package Demo; public class Demo4 { public static void main(String[] args) { String str = "helloworld"; System.out.println(str.substring(5)); //world 从 阅读全文
posted @ 2017-05-09 23:34 记录一生 阅读(65) 评论(0) 推荐(0)
 
1.10 字符串比较 内容忽略大小写方法
摘要: package Demo; public class Demo4 { public static void main(String[] args) { String str = "helloworld"; System.out.println(str.equals("Helloworld")); / 阅读全文
posted @ 2017-05-09 23:28 记录一生 阅读(148) 评论(0) 推荐(0)
 
1.9 获取指定位置的字符
摘要: package Demo; public class Demo4 { public static void main(String[] args) { String str = "helloworld"; System.out.println("字符串的长度为:"+str.length()); fo 阅读全文
posted @ 2017-05-09 23:19 记录一生 阅读(119) 评论(0) 推荐(0)
 
1.8 取出指定位置的字符
摘要: package Demo; public class Demo3 { public static void main(String[] args) { String str = "helloworld"; System.out.println(str.charAt(0));//h System.ou 阅读全文
posted @ 2017-05-09 23:14 记录一生 阅读(106) 评论(0) 推荐(0)
 
1.7 字符串和字符数组的转换
摘要: package Demo; public class Demo2 { public static void main(String[] args) { String str = "helloworld"; char c[] = str.toCharArray(); //字符串转换为字符数组 for( 阅读全文
posted @ 2017-05-09 23:11 记录一生 阅读(119) 评论(0) 推荐(0)
 
1.6 字符串的比较
摘要: package Demo; public class Demo1 { public static void main(String[] args) { String s1 = "Hello"; String s2 = new String("Hello"); String s3 = s2; //"= 阅读全文
posted @ 2017-05-09 22:47 记录一生 阅读(108) 评论(0) 推荐(0)
 
1.5 重点
摘要: package Employ; public class EmpDemo { public static void main(String[] args) { Emp emp =new Emp(1001,"张三丰",1000,200); Emp emp1 = new Emp(1002,"张无忌",2 阅读全文
posted @ 2017-05-09 20:55 记录一生 阅读(76) 评论(0) 推荐(0)
 
1.4 99乘法表
摘要: public class Deom4 { public static void main(String[] args) { int i ; int j; int product; for(i =1;i<10;i++){ for(j =1;j<=i;j++){ product= i*j; System 阅读全文
posted @ 2017-05-09 08:00 记录一生 阅读(108) 评论(0) 推荐(0)
 
1.3 构造方法
摘要: public class Demo2 { public static void main(String[] args) { Person p1 = new Person(); Person p2 = new Person("黄蓉"); Person p3 = new Person("杨过",18); 阅读全文
posted @ 2017-05-09 00:25 记录一生 阅读(90) 评论(0) 推荐(0)
 
下一页