Java tuts notes - ch1
来源:互联网 发布:玻璃优化软件下载 编辑:程序博客网 时间:2024/05/20 13:38
Environment Configuration:
Java_Home: xxx/xxx/java/jdl-....
path: the path of jdk including bin directroy. Defined as %Java_Home% variable
classpath: the path of jdk library %Java_Home%\lib\tools.jar dt.jar
!!!!classpath should contain " . " (current working directory) otherwise every time u compile should add the parameter -classpath .
Basic data type:
char 16
byte 8, short 16, int 32, long 64 - default is int
float 32, double 64 -default double
tips:
Small automatically converts into Big eg. "int = byte" is valid
Output:
1. console
System.out.printLn("XXXX");
System.out.printf("%d %d", x, y);
2. message box
String s="x="+x;
JOptionPane.showMessageDialog(null, s);
Input:
Type in:
System.in
import java.util.Scanner;
Scanner scan = new Scanner(System.in);
Message Box:
import javax.swing.JOptionPane;
String = "";
s = JOptionPane.showInputDialog(null, "Please type in a number: ");
int x = Integer.parseInt(s);
Java Programming Structure:
1. Branch
a.
If (condition) {
.....
}
b.
if (condition) {
} else {
}
c.
if (condition) {
} else if () {
} else if () {
} else {
}
d.
switch(expression) { //int, char
case value1:
...;
case value2:
...;
[default]:...;
}
2. Loop
while() {}
do {} while();
for (;;)
As the grammar in C++
3. Logic Expression
!, &&, || - logic op(short-circuit evaluation)
&, | - bit op
- Java tuts notes - ch1
- NOTES ON GIT PRO CH1 GETTING STARTED
- java基础ch1
- Java OOP ch1
- A First Course in Database Systems - notes ch1
- RapidMiner tuts
- envato-tuts+
- 《Java数据结构与算法》笔记-CH1
- Java - Notes
- notes[java]
- java notes
- java notes
- Java Notes
- Java Notes
- Introduction to C++ for Financial Engineers-Study Notes 1(Ch1-Ch7)
- CH1 对象导论——Thinking in Java 读书笔记
- Java 游戏开发Notes
- Java Thread - Notes
- (libgdx小结)粒子编辑器
- hdu1500 动态规划
- 第二周上机错误程序——有序的结构体数组(求高人给指点迷津,程序不能运行,快难死俺了)
- ffmpeg压缩yuv
- repmat
- Java tuts notes - ch1
- C与C#的区别
- c++ 字符串流 sstream(常用于格式转换)
- 微信/微博信息整合
- 中国电科41所推出光纤应变分布测试仪
- 爱情真诚
- sencha touch中出现JS错误Uncaught TypeError: Object [object Object] has no method 'getForm'
- 两个ubuntu系统之间的文件拷贝
- 区间K大数查询