java程序设计基础篇 复习笔记 第七单元&&第八单元

7.1
int[][] triArray{
	{1},
	{1,2},
	{1,2,3},
};
7.2
array[2].length

8.1
Unified Modeling Language:UML
UML class diagram
Circle
_____________
radius:double
_____________
+Circle()
+Circle(newRadius:double)
getArea():double

circle1:Circle
_________
radius = 19

8.2
client
8.3
reference variable
ClassName objectRefVar;
null
NullPointerException
8.4
object member access operator:.
instance variable
instance method
static variable:class variable
static method

getter:accessor
setter:mutator

pass by value

calling object
8.5
java.util.Date
+Date()
+Date(elapseTime:long)

+toString():String
+getTime():long

+setTime(elapseTime: long)void
8.6
java.util.Random
+Random()
+Random(seed:long)
+nextInt():int
+nextInt(n:int):int
+nextLong():long
+nextDouble():double
+nextFloat():float
+nextBoolean():boolean
//Random random1 = new Random(3)
8.7
javax.swing.JFrame
Jframe frame1 = new JFrame();
frame1.setTitle("Window 1");
frame1.setSize(200,150);
frame1.setLocation(200,100);
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame1.setVisible(true);
JButton jbtOK = new JButton("OK");
JLabel jlblName = new JLabel("Enter your name: ");
JTextField jtfName = new JTextField("Type in here");
JCheckBox jchkBold = new JCheckBox("B");
JRadioButton jrbRed = new JRadioButton("Red");
JComboBox jcboColor = new JComboBox(new String[]{"freshman","sophomore","junior","senior"});
JPanel panel = new JPanel();
panel.add(jbtOK);
8.8
Math.PI
8.9
package-private:package-access
private:类的成员
public:类

Keyword:
accessor method:getter method
action
attribute
behavior
class
client
constructor
data field
date-field encapsulation
default constructor
dot operator:object access operator
instance
instance method
instance variable
instantiation
mutator method:setter
null
no-arg constructor
object-oriented programming:OOP
Unified Modeling Language:UML
package-private:package-access
private
property
public
reference variable
reference type
state
static variable
static method

  

时间: 2024-10-02 04:42:33

java程序设计基础篇 复习笔记 第七单元&&第八单元的相关文章

java程序设计基础篇 复习笔记 第一单元

java语言程序设计基础篇笔记1. 几种有名的语言COBOL:商业应用FORTRAN:数学运算BASIC:易学易用Visual Basic,Delphi:图形用户界面C:汇编语言的强大功能和易学性,可移植性C++:系统软件C#:.netjava:互联网应用程序2. java语言规范:java.sun.com/docs/books/jls 对语言的技术定义javaAPI(Application Program Interface):预定义的类和接口3.javaEE:服务器端的应用程序javaSE:

java程序设计基础篇 复习笔记 第二单元

1原始数据类型(primitive data type) == 基本类型 (fundamental type)byte short int long float double char boolean引用类型 reference type2System.in System.outjava.util.ScannerScanner input = new Scanner (System.in);nextByte()nextShort()nextInt()nextLong()nextFloat()ne

java程序设计基础篇 复习笔记 第六单元

第六章 一维数组 1 数组初始化语法 array initializer 2 for each loop 3 off-by-one error 通常是在循环中该使用<的地方使用了<= 4 复制数组:1.for 2.System.arraycopy 3.clone 5 arraycopy(sourceArray, src_pos, targetArray, tar_pos, length); 6 匿名数组: anonymous array 7 值传递 pass by value 8 变长参数 h

java程序设计基础篇 复习笔记 第三单元

1 单向if语句 双向if语句 dangling else switch:char,byte,short,int 2 javax.swing.JOptionPane.showConfirmDialog(null,text); 返回值: JOptionPane.YES_OPTION:0 JOptionPane.NO_OPTION:1 JOptionPane.CANCEL_OPTION:2 3 cannot cast int from boolean cannot cast boolean from

java程序设计基础篇 复习笔记 第五单元

1. method header: modifier, return value type, method signature(method name, parameter) method body 2. value-returning method void method method overloading ambiguous invocation: max(int,double) max(double,int) 3. formal parameter actual parameter pa

java程序设计基础篇 复习笔记 第四单元

1 think before coding code incrementally 2 sentinel value sentinel-controlled loop 3 输入输出重定向 > < input redirection output redirection 4 pretest loop posttest loop 5 从小到大添加浮点数比从大到小精确 6 Integer.toBinaryString(int) Integer.toHexString(int) 7 PIE =4* (1

Java语言程序设计基础篇 循环(四)

①打印:***** **** *** ** * for(int x=1; x<=5; x++) { for(int y=x; y<=5; y++) { System.out.print("*"); //向下一般的格式for(int y=x; y<=5; y++) } System.out.println(); } ②打印:* ** *** **** ***** for (int x=1; x<=5 ;x++ ) { for (int y=1;y<=x ;y

Java语言程序设计基础篇 方法(五)

生成随机字符 生成随机字符就是生成0到65535之间的一个随机整数,因为0<=Math.random()<1.0,必须在65535+1 (int) (Math.random() * (65535+1)) 随机生成小写字母 public class RandomCharacter { public static char getRandomCharacter(char ch1,char ch2){ return (char)(ch1 +Math.random() * (ch2 - ch1 + 1

Java语言程序设计基础篇 循环(四)练习

*4.21(计算不同利率下的贷款)编写程序,让用户输入贷款总额及以年为单位的贷款期限,以1/8为递增量,显示从5%到8%的利率下每月支付额和总偿还额.假设输入贷款总量为10 000,还贷期限为5年,所显示的输出如下: 贷款总额:to 000 年数:5 利率月支付额总偿还额 5%188 .71   11322.74 5 .125%189.28   11357.13 5 .25%189.85   11391.59 ... //Exercise3_26.java: displays the month