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






百易城

 
 

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

2014年2月11日

Java程序中构造函数,重载
摘要: Java代码 class Tree { int height; Tree() { print("Planting a seedling"); height = 0; } Tree(int i) { print("Creating new Tree that is "+ i + " feet tall"); height = i; } public void plant() { print("Tree is " + height + " feet tall"); } public void pla 阅读全文
posted @ 2014-02-11 14:15 百易城 阅读(257) 评论(0) 推荐(0)
 
使用for语句打印图形
摘要: public class Print { public static void main(String[] args) { int num=11; //打印上半部分 for(int i=0;i { for(int j=num;j>i+1;j--) { System.out.print(" "); //打印空格 } for(int j=0;j0;i--) { for(int j=0;j { System.out.print(" "); //打印空格 } for(int j=i;j>0;j--) { System.out.print(" 阅读全文
posted @ 2014-02-11 14:14 百易城 阅读(548) 评论(0) 推荐(0)
 
JavaSE语法基础总结
摘要: 1 掌握Java基本数据类型 基本数据类型:又称为内置类型,是Java中不同于类的特殊类型。它们是我们编程中使用最频繁的类型。 1)Java有八种基本数据类型,分别为 boolean , byte, short, char, int, long, float, double 2)由低级向高级的转换自动完成 由高级向低级的转换强制完成 3)各种数据类型中,由低到高的级别顺序为:byte、char、short、int、long、float、double 2 掌握Java变量的含义及定义 1)变量名的命名规则: 变量名是以字母、下划线、$开始并在其后跟数字、字符等所组成的一个字符串... 阅读全文
posted @ 2014-02-11 11:58 百易城 阅读(223) 评论(0) 推荐(0)