java热冷饭(1)
bigzhu
posted @ Nov 16, 2007 10:12:00 PM
in java
, 1284 阅读
因为工作需要,开始热java的冷饭,毕竟放了快2年没动了.开始看java core主要记录一些要点,包括以前忘记掉的.
- java程序的全部内容都必须放置在class中
- class命名规范:单词开头大些字母,多个单词则每个都开头大些,词与词之前无下划线.
- 源代码文件名必须与public class的名字相同, .java作为文件后缀.
- jdk 1.4之后,强制main方法必须被声明为public的
- 有boolean类型:false,true两个类型.注意1不代表true,0也不代表false
- final定义常量,static final定义一个类常量,类常量定义在最外层类中,那么类中所有方法都可以使用这个常量.
- java支持三元操作:condition?expression1:expression2 条件为真,则返回expression1,否则返回expression2; ps:其实这是个蛮好用的东西,但是不知道为什么我一直不喜欢,也很少用,也许每次在用或者代码里面看到它的时候,总是脑子要转个弯,要转化为if,反而没得直接看到if else来得自然,虽然更简洁一些.(3.5.2)
- 静态方法?? 不懂. jdk 5.0以后,调用Math方法,不必再添加前缀了,比如求平法:Math.sqrt()
Sep 29, 2022 01:19:15 AM
Most of the candidates show interest to download NCERT English Sample Paper 2023 Class 11 to gain high score in different types of exams such as Term-1, Term-2. Most of the candidates show interest to download NCERT English Sample Paper 2023 Class 11 to gain high score in different types of exams such as Term-1, Term-2 and other types of exams. Basically for 11th standard students these exams are conducting by the Board of NCERT to check the students individual abilities. and other types of exams. NCERT English Sample Paper Class 11 Basically for 11th standard students these exams are conducting by the Board of NCERT to check the students individual abilities.