码家

Web Platform, Cloud and Mobile Application Development

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

文章分类 -  【4】【Java】

上一页 1 2 3 4 5 6 7 下一页

摘要:1. 阅读全文
posted @ 2011-05-22 09:34 海山 阅读(100) 评论(0) 推荐(0)

摘要:1 阅读全文
posted @ 2011-05-22 09:30 海山 阅读(146) 评论(0) 推荐(0)

摘要:1.当一个变量对于类的对象来说是共同的,这个时候需要使用一个概念:static2.用到的关键字是”static”3.在Java中,static关键字被用在三种场景用于实例变量用于方法用于一段代码4.Static Variables5.Static Methods6.Static BlockRetail Application – Case Studyclass Customer{ private int customerId = 1000; public Customer(){ customerId++; } public int getCustomerId(){ return custome 阅读全文
posted @ 2011-05-22 09:30 海山 阅读(220) 评论(0) 推荐(0)

摘要:构造函数是一种特殊的方法,和class有相同的名字构造函数是用来初始化类的实例变量的构造函数有两种类型:默认的构造函数和参数化的构造函数ØConstructor is a special method that has the same name as that of a class ØThe constructor is used to initialize the instance variables of the class ØTypes of constructors:§Default constructor§Parameterized 阅读全文
posted @ 2011-05-22 09:28 海山 阅读(2824) 评论(0) 推荐(0)

摘要:一组相关的字符可以用string来表示在Java中,是用内置的类来实现的,这个类置的类是StringString不是简单的字符的数组其中没有终止字符’\0’ 3. 创建并初始化一个String 的对象 阅读全文
posted @ 2011-05-22 09:27 海山 阅读(120) 评论(0) 推荐(0)

摘要:1. 阅读全文
posted @ 2011-05-22 09:26 海山 阅读(128) 评论(0) 推荐(0)

摘要:public class Aaa{ public static void main(String[] args){System.out.print("执行偶吧!"); } }保存为:Aaa.java编译:在开始--运行--输入:cmd输入:cd 指定你保存文件的文件夹路径--dir找到这个文件开始输入:javac Aaa.java运行:java Aaa 阅读全文
posted @ 2011-05-21 20:20 海山 阅读(538) 评论(0) 推荐(0)

摘要:1 阅读全文
posted @ 2011-05-21 15:54 海山 阅读(161) 评论(0) 推荐(0)

摘要:1 阅读全文
posted @ 2011-05-21 15:53 海山 阅读(114) 评论(0) 推荐(0)

摘要:1 阅读全文
posted @ 2011-05-21 15:52 海山 阅读(340) 评论(0) 推荐(0)

摘要:一、Retail Application – Case Studyclass Customer{ private int customerId; private long telephoneNo; public void setCustomerId(int customerId){ customerId = customerId; } public int getCustomerId(){ return customerId; }}class Retail{public static void main(String args[]){ Customer custObj = new Custom 阅读全文
posted @ 2011-05-21 15:51 海山 阅读(153) 评论(0) 推荐(0)

摘要:1 阅读全文
posted @ 2011-05-21 15:50 海山 阅读(128) 评论(0) 推荐(0)

摘要:1. 阅读全文
posted @ 2011-05-21 15:33 海山 阅读(118) 评论(0) 推荐(0)

摘要:1.Whenever an object is created , memory wil be allocated for the instance variables also.They will be stored in the heap memory along with the object to which they belong2.Note :Here it is assumed that reference variable declaration is done inside the main() method,hence will be treated as a local 阅读全文
posted @ 2011-05-21 15:32 海山 阅读(108) 评论(0) 推荐(0)

摘要:1.Java Programming Language2.Java Byte Code3.Java Virtual Machine1.Java Program(.java)2.Java Compiler(javac)3.ByteCode(.class)4.Interpreter5.Win32、Linux、Mac 阅读全文
posted @ 2011-05-21 15:25 海山 阅读(194) 评论(0) 推荐(0)

摘要:1.Customer classsclass Customer{ private int customerId; private long telephoneNo; public void setCustomerId(int id){ cutomerId=id; } public void setTelephoneNo(long teleNo){ telephoneNo=teleNo; } public int getCustomerId(){ return customerId; } public long getTelephoneNo(){ return telephoneNo; }}2. 阅读全文
posted @ 2011-05-21 15:17 海山 阅读(343) 评论(0) 推荐(0)

摘要:1. 阅读全文
posted @ 2011-05-21 14:52 海山 阅读(117) 评论(0) 推荐(0)

摘要:1.在编辑器中写下代码2.保存文件3.编译程序4.执行代码 阅读全文
posted @ 2011-05-21 14:35 海山 阅读(82) 评论(0) 推荐(0)

摘要:1.类是创建一个对象的蓝图2.要实现一个类,就要创建一个对象3.对象是类的实例4.一个类可以有很多实例,每个实例可以有自己的数据5.运算符new用来在运行时动态的为对象分配内存(dynamic memory allocation)6.创建一个对象时会为对象生成一个引用(参考、参照),为对象新创建的引用必须赋值个一个变量,这个变量被称作引用变量;可以给引用变量赋值null,这样不指向任何对象。 阅读全文
posted @ 2011-05-21 14:34 海山 阅读(191) 评论(0) 推荐(0)

摘要:1.标示符的规范化2.变量3.数据类型4.方法5.访问控制符6.用JAVA来实现一个类 阅读全文
posted @ 2011-05-21 11:28 海山 阅读(134) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 下一页