Learn Java01
来源:互联网 发布:一键越狱软件 编辑:程序博客网 时间:2024/05/18 02:26
1.== and equals
the operator ==
wiil say if they are the same, if you want to check if they are logically equal
2.Arrays in Java are also objects.
3.float a=1.0f; or float a=(float) 1.0;
4.Foreach
char[] chars={'a','b','c'};
for(char c:chars)
{
}
5.The Arguments of Functions
I always like to say that arguments to Java methods are passed by value.
Student joe = new Student("joe");Student jack = new Student("jack");bar2(joe, jack);
In bar2just like
Student s1 = joe;Student s2 = jack;
s1== joe
is true. This means that running methods on s1
will change the object joe
. But if we'll change the value of s1
as a reference, it will not affect the reference joe
.Summary
- Every Java method has to be within a class
- Static methods belong to a class while non-static methods belong to objects
- All parameters to functions are passed by value, primitives content is copied, while objects are not copied and some would say 'passed by reference'
阅读全文
0 0
- Learn Java01
- JAVA01
- Java01
- 学习java01
- java01.基础知识
- 初学JAVA01
- Java01 What is java
- [java01]Java基本数据类型
- java01基础简介
- code hunt JAVA01
- [Java01]实现文件重命名
- Java01-"Hello World!"
- 在北京黑马学习Java01
- Android学习笔记之java01
- learn
- learn
- 读书笔记-Thinking in Java01-对象导论+一切都是对象
- Android学习笔记之java01(更换账号)
- nuttx-smartfs
- Spark-Sql启动报错:Error creating transactional connection factory
- [Java] 静态方法与非静态方法的区别
- java数组发牌
- Linux查看程序端口占用情况
- Learn Java01
- TCP/IP协议理论
- Oaecle 命令行基础操作篇(5)
- 博弈——Nim or not Nim?
- SQL优化
- JavaWeb入门学习
- TypeScript学习笔记(二)之Browserify Gulp
- 用正则校验IP地址与MAC地址
- HDU