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






许先

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页

2016年5月27日

9.不能被继承的情况1
摘要: package cn.jbit.epet.purview; /** * 狗狗类,宠物的子类。 */ public class Dog extends Pet { private String strain;// 品种 /** * 有参构造方法。 * @param name 昵称 * @param strain 品种 */ ... 阅读全文
posted @ 2016-05-27 23:16 许先 阅读(167) 评论(0) 推荐(0)
 
8.static方法使用
摘要: package staticDemo; /* * 一群选民进行投票,每个选民只允许投一次票,并且当投票总数达到100时,就停止投票 * Voter:选民类 * */ public class Voter { private static int count; // 所有选民都会改变同一个数据:投票次数 private static final int MAX_COUNT ... 阅读全文
posted @ 2016-05-27 23:14 许先 阅读(567) 评论(0) 推荐(0)
 
7.static变量使用
摘要: package staticDemo; /* * 一群选民进行投票,每个选民只允许投一次票,并且当投票总数达到100时,就停止投票 * Voter:选民类 * */ public class Voter { private static int count; // 所有选民都会改变同一个数据:投票次数 private static final int MAX_COUNT ... 阅读全文
posted @ 2016-05-27 23:12 许先 阅读(290) 评论(0) 推荐(0)
 
6.简易计算器
摘要: public class Calc { public int getSum(int num1,int num2){ return num1+num2; } public double getSum(double num1,double num2,double num3){ return num1+num2+num3; ... 阅读全文
posted @ 2016-05-27 23:09 许先 阅读(194) 评论(0) 推荐(0)
 
5.用户密码管理
摘要: public class Administrator { String name; //姓名 String password; //密码 //显示信息方法 public void show(){ System.out.println("姓名:" + name + ",密码:" + password); } } ... 阅读全文
posted @ 2016-05-27 23:08 许先 阅读(243) 评论(0) 推荐(0)
 
4.方法重载
摘要: package structMehtod; public class Calc { public int getSum(int num1,int num2){ System.out.println("int"); return num1+num2; } public double getSum(double num1,doubl... 阅读全文
posted @ 2016-05-27 23:06 许先 阅读(183) 评论(0) 推荐(0)
 
3.对象数组做参数
摘要: //学生类 public class Student { //属性 public String name;//姓名 public int score; //方法 public void showInfo(){ System.out.println(name+"的成绩是:"+score); } } public clas... 阅读全文
posted @ 2016-05-27 23:05 许先 阅读(518) 评论(0) 推荐(0)
 
2.迷你DVD管理系统
摘要: import java.util.*; public class MyDVDMgr { public static void main(String[] args){ Scanner input=new Scanner(System.in); //是否退出系统,false代表退出系统 boolean flag=true; ... 阅读全文
posted @ 2016-05-27 23:02 许先 阅读(1854) 评论(0) 推荐(0)
 
1.二维数组计算班级成绩
摘要: import java.util.Scanner; /** * 已知有3个班级各5名学员,请使用二维数组计算各个班级的总成绩 * */ public class ThreeTotal { public static void main(String[] args) { Scanner input=new Scanner(System.in); int... 阅读全文
posted @ 2016-05-27 23:01 许先 阅读(1468) 评论(0) 推荐(0)
 
31.向数组中插入一个元素
摘要: import java.util.*; public class Insert { public static void main(String[] args) { int[] list = new int[6]; // 长度为为6的数组 list[0] = 99; list[1] = 85; list[2] = 82;... 阅读全文
posted @ 2016-05-27 22:59 许先 阅读(349) 评论(0) 推荐(0)
 
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页