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






Lovemeifyoudare

 
 

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

2019年1月22日

接口匿名内部类
摘要: package object01; interface Eatable { void taste();} interface Flyable { void fly(String weather);} interface Addable { double add(int a, double b);} 阅读全文
posted @ 2019-01-22 20:00 Lovemeifyoudare 阅读(156) 评论(0) 推荐(0)
 
枚举类
摘要: package object01; public enum Season { //定义枚举类 spring, summer, autumn, winter;} //测试 public class EnumTest { public void judge(Season a) { switch (a) 阅读全文
posted @ 2019-01-22 19:53 Lovemeifyoudare 阅读(91) 评论(0) 推荐(0)
 
接口.匿名内部类
摘要: package object01; public interface Command {//定义一个接口 让其他类去实现 void pArray(int[] arr); //打印数组 int addArray(int[] arr); //数组求和} public class InplementArr 阅读全文
posted @ 2019-01-22 19:44 Lovemeifyoudare 阅读(211) 评论(0) 推荐(0)
 
学生信息管理系统(bug)
摘要: 建立一个包含学生、家长、老师、班级的学校管理模型,系统录入、查询学生信息、家长信息、老师,以及班级的信息,注意,要建立各信息间的关联 //学生类 package demo; public class Student { private String name; private int Cid; pr 阅读全文
posted @ 2019-01-22 18:31 Lovemeifyoudare 阅读(234) 评论(0) 推荐(0)
 
System类
摘要: package baseClass7; import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.util.Map;import java.u 阅读全文
posted @ 2019-01-22 18:22 Lovemeifyoudare 阅读(103) 评论(0) 推荐(0)
 
StringBuilder类
摘要: package baseClass7; public class StringBuilderClass { public static void main(String[] args) { String s1 = "chaoqiqiang.chaoqq.cqq"; String s2 = ".cha 阅读全文
posted @ 2019-01-22 18:21 Lovemeifyoudare 阅读(93) 评论(0) 推荐(0)
 
Runtime类
摘要: package baseClass7; import java.io.IOException; public class RuntimeTest { public static void main(String[] args) { // 获取Java程序关联的运行时对象 Runtime rt = R 阅读全文
posted @ 2019-01-22 18:08 Lovemeifyoudare 阅读(93) 评论(0) 推荐(0)
 
递归(99乘法表)
摘要: public class RecursionJJ { public static void main(String args[]) { m(9); } public static void m(int i) { if (i == 1) { System.out.println("1*1=1 "); 阅读全文
posted @ 2019-01-22 18:02 Lovemeifyoudare 阅读(275) 评论(0) 推荐(0)
 
计算某天是在一年中的第几天
摘要: public class YmDay { public static void main(String[] args) { int year = 2009, month = 1, day = 8; int m2; if (year % 100 == 0 && year % 400 == 0 || y 阅读全文
posted @ 2019-01-22 17:49 Lovemeifyoudare 阅读(517) 评论(0) 推荐(0)
 
数组逆序输出
摘要: public class Shuzunixu { public static void main(String arg[]) { Array(new int[] { 1, 2, 3, 4, 5, 6 }); } public static void Array(int arr[]) { for (i 阅读全文
posted @ 2019-01-22 17:30 Lovemeifyoudare 阅读(203) 评论(0) 推荐(0)
 
打印数组格式
摘要: public class Shuzu { public static void main(String arg[]) { printArray(new int[] { 1, 2, 3 }); } public static void printArray(int[] arr) { System.ou 阅读全文
posted @ 2019-01-22 17:22 Lovemeifyoudare 阅读(150) 评论(0) 推荐(0)
 
选择排序(直接把最小或最大的数选出来排列)
摘要: public class Select { public static void main(String[] args) { selectArray(new int[] { 6, 73, 23, 15, 45, 20, 56, 3, 89 }); } public static void selec 阅读全文
posted @ 2019-01-22 17:16 Lovemeifyoudare 阅读(327) 评论(0) 推荐(0)
 
冒泡排序
摘要: package test; public class Maopao { public static void main(String[] args) { array(new int[] { 6, 73, 23, 15, 45, 20, 56, 3, 89 }); } public static vo 阅读全文
posted @ 2019-01-22 16:57 Lovemeifyoudare 阅读(111) 评论(0) 推荐(0)
 
比较两个字符数组是否相等
摘要: import java.util.Arrays; public class Kong { public static void main(String[] args) { int[] arr = { 'a',99, 93, 92, 97, 'b' }; int[] arr2 = {97, 'c', 阅读全文
posted @ 2019-01-22 16:16 Lovemeifyoudare 阅读(1188) 评论(0) 推荐(0)
 
汉字转阿斯克马值
摘要: package test; public class HanZhuanMa { public static void main(String[] args) { String cn = "麒强"; System.out.println(cnToUnicode(cn));// 输出\u9e92\u5f 阅读全文
posted @ 2019-01-22 16:09 Lovemeifyoudare 阅读(727) 评论(0) 推荐(0)
 
控制流输出26大小写英文字母
摘要: public class DXX { public static void main(String []args){ char dx='A',xx='a'; for(int i=0;i<26;i++,dx++,xx++){ System.out.println("大写字母:"+dx+",小写字母:" 阅读全文
posted @ 2019-01-22 16:05 Lovemeifyoudare 阅读(301) 评论(0) 推荐(0)
 
员工领导部门关系类
摘要: public class Employee {//员工类 private String name; private int number; private double salary; private double bonus; private Employee leader; private De 阅读全文
posted @ 2019-01-22 15:50 Lovemeifyoudare 阅读(268) 评论(0) 推荐(0)
 
重写父类
摘要: package objectUp; class BaseClass { public BaseClass() { String book = "caa"; this.test(); } public void base() { System.out.println("我是父类的方法"); } pub 阅读全文
posted @ 2019-01-22 15:24 Lovemeifyoudare 阅读(102) 评论(0) 推荐(0)
 
递归(recursion)
摘要: package objectUp; public class recursion { /* * 已知一个数列:(f0) =1,(f1)=4, f(n +2)=2*f(n+1) +f(n),其中n是大于0的整数,求 f(n)的值。 * * 倒过来:f(20)=1,f(21)=4,f(n +2)=2*f 阅读全文
posted @ 2019-01-22 14:53 Lovemeifyoudare 阅读(238) 评论(0) 推荐(0)
 
instanceof运算符
摘要: package objectUp; public class InstanceofTest { /* * instanceof(译:实例 判断对象类型 运算符)运算符前一个操作数 通常是一个引用类型变量 后一个操作数通常是类或接口(接口是一个特殊的类) * 用于判断前面的对象是否是后面的类 或者是他 阅读全文
posted @ 2019-01-22 14:46 Lovemeifyoudare 阅读(157) 评论(0) 推荐(0)