1005 的 Mid 来了 学这么课的进来讨论一下 必须掌握的概念

Snail0369

知名会员
注册
2002-05-03
消息
1,954
荣誉分数
5
声望点数
148
今天开始看Java笔记了 自己总结了一点需要知道的概念, 如果有错 大家一起指出并修改

Call method
for static method className.methodName()
for instance method object.instantname()

type casting
implicit type casting [automaticly]
explicit type casting [ you have to claim it yourself to allow computer to do a type casting ]
example:
double d = 1.2;
float f = 1.5f;
d = f; // implicit type casting
f = (float)d; // explicit type casting

char c;
c = (char)(c - 'a' + 'A');

Math belongs to the package of java.lang,
all return types are double, except abs(x) whose return type is still the origin type of x.

boolean aaa = true; aaa is a flag

array can be a parameter and a return type
public static int [ ] reverse (int [ ] anArray) //page 31
int [ ] anIntArray = new int [10];//creat and initial to 0
type array arrayname create type array.length
int [ ] anArray = {1, 2, 3, 4};
int [ ] [ ] anArray = new int [m][n]; //m = row, n = column

++i one step, return i + 1 [ 号称速度比较快, 返回的是新的值 ]
i++ two steps, declare i and return i, then assignment i = i + 1 [ 返回的是老的值 ]

大家一起贴呀
 
math is a protacted object.
you can't make actual object. and almost all methods of math are static...so when we call, we use Math.methodName();
 
最初由 Snail0369 发布
++i one step, return i + 1 [ 号称速度比较快, 返回的是新的值 ]
i++ two steps, declare i and return i, then assignment i = i + 1 [ 返回的是老的值
++i 和 i++ 实际上用起来没有区别

midterm 到底考什么的?选择题?对错题?填空?还是编程?我想不大可能是编程吧,时间不允许
 
mark以前习惯出编程题
小部分填空,判断和选择
其他多数为写代码
 
++前 和 后++当然有区别。而且,老师会特第出OUTPUT的题目,见别++的问题
 
TA的公告
我对上面的考试时间表示疑惑(8:30--13:30?????)

Hello everybody,

I would like to remind you that you will write your
midterm this week The midterm will be 2 hours long.

The test starts at the beginning of class at 8:30 pm
and I'll begin timing whether you are there or not!
The timing for each section of the test will be kept.
I will not allow extra time for one part or you won't
have time for the rest. The test ends at 13:30 pm
sharp.

The portfolio check was rescheduled for next week. I
will email you details about it later on. So on Friday
you do not need to worry about it.

See you,
Georgie
 
后退
顶部