程序源入坑之路1
来源:互联网 发布:手机金山数据恢复大师 编辑:程序博客网 时间:2024/06/08 06:39
IDE:代码编译器
JDK: Java 语言的软件开发工具包
JRE:运行JAVA程序所必须的环境的集合,包含JVM标准实现及Java 核心类库。
JVM:java虚拟机
标识符:标识符是用户编程时使用的名字,对于变量、常量、函 数、语句块也有名字;我们统统称之为标识符。
关键字:是电脑语言里事先定义的,有特别意义的标识符,有时又叫保留字,还有特别意义的变量。Java语言规定关键字不能作为标识符。
基本数据类型:
byte(字节)
shot(短整型)
int(整型)
long(长整型)
float(浮点型)
double(双精度)
char(字符型)
boolean(布尔型)
对象:拥有属性的东西
抽象类:使用了关键词abstract声明的类叫作“抽象类”。如果一个类里包含了一个或多个抽象方法,类就必须指定成abstract(抽象)。
接口:是一系列方法的声明,是一些方法特征的集合,一个接口只有方法的特征没有方法的实现,因此这些方法可以在不同的地方被不同的类实现,而这些实现可以具有不同的行为(功能)。
静态方法:static,可以直接被调用,无需实例化。
`public class Ch1 {
private double width;
private double height;
public Ch1() { // TODO Auto-generated constructor stub}public Ch1(double width,double height){ this.width=width; this.height=height;}public double getWidth(){ return this.width;}public void setWidth(double width){ this.width=width;}public double getHeight(){ return this.height;}public void setHeight(double height){ this.height=height;}public static void main(String[] args) { Ch1 i1=new Ch1(); i1.setWidth(3); i1.setHeight(3); System.out.println("宽为"+i1.getWidth()+"长为"+i1.getHeight());}
}`
public class Account { private String name; private String pwd; private double money; public Account(){ } public Account(String name,String pwd,double money){ this.name=name; this.pwd=pwd; this.money=money; } public double deposit(double a){ this.money=this.money-a; return a; } public void draw(double b){ this.money=this.money+b; } public void showMoney(){ System.out.println("账户余额"+this.money); } public String getName(){ return this.name; } public void setName(String name){ this.name=name; } public String getPwd(){ return this.pwd; } public void setPwd(String pwd){ this.pwd=pwd; } public double getMoney() { return money; } public void setMoney(double money) { this.money = money; } public static void main(String[] args){ Account zh=new Account("zhangluoyuan","1401030118",10000); double n=zh.deposit(50); zh.draw(200); zh.showMoney(); }}
- 程序源入坑之路1
- 程序源入坑之路2
- 程序源入坑之路3
- 程序源入坑之路4(web)
- 程序之路
- rate程序之路--
- 开启程序之路
- 程序媛之路。
- 程序媛之路
- 十年程序之路
- 程序思想之路
- 程序学习之路
- 程序之路展望
- 程序之路
- 程序之思考(1)
- 程序源入坑之路5(c语言入门)
- {linux程序}之网络程序的并发之路
- 我的程序之路
- 剑指Offer--021-支持min操作的栈
- 八皇后(N皇后)问题算法程序(回溯法)
- 1013-A strange lift
- linux切换多版本的php
- OAuth2学习笔记(2)——角色
- 程序源入坑之路1
- 模板方法模式
- PHP,ASP,JSP的区别
- 程序员技术提升攻略
- 提高 MyEclipse 开发速度
- leetcode笔记:Implement Trie (Prefix Tree)
- WebApi 跨域调用
- dns server 配置
- 在适配器中使用final遇到的问题