![]() | คำสงวน เครื่องหมายคำนวณ เปรียบเทียบ และ ตัวอักษร | ![]() |
| Format of class |
|
c:\test.java
class test {
public static void main(String args[]) {
System.out.println("a");
}
}
c:\test.java
class test {
public static void main(String args[]) {
new burin().ok();
}
}
class burin {
void ok() {
System.out.println("b");
}
}
c:\test.java
class test {
public static void main(String args[]) {
new testsub().wow();
}
}
c:\testsub.java
class testsub {
void wow() {
System.out.println("a");
}
}
| Classification | Operators |
| Arithmetic | + - * / % |
| Relational Operators | < > >= <= == != && || ! |
| Bitwise Operators | & | ^ << >> >>> - &= |= ^= |
| Assignments | = += -= /= %= |
| Bitwise Assignments | &= |= <<= >>= >>>= ^= |
| Ternary Operator (if...else shorthand) | ?: |
| Increment | ++ |
| Decrement | -- |
ตัวอย่าง
1. แบบเรียงอักษร : 49 Java Keywords abstract boolean break byte case catch char class const continue default do double else extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while assert
| 2. แบบแยกกลุ่มใหญ่ | |||
|
|
|
|
\b \u0008: backspace BS \t \u0009: horizontal tab HT \n \u000a: linefeed LF \f \u000c: form feed FF \r \u000d: carriage return CR \" \u0022: double quote " \' \u0027: single quote ' \\ \u005c: backslash \ OctalEscape \u0000 to \u00ff: from octal valueตัวอย่างการใช้ class test { public static void main(String args[]) { System.out.println("a" + "\n" + "b" + "\n"); } }
| Access Level ? | ||||
| Specifier | Class | Package | Subclass | World |
| public | / | / | / | / |
| protected | / | / | / | . |
| no modifier | / | / | . | . |
| private | / | . | . | . |
|
8. ศัพท์เทคนิก (Technical Term)
- UML (Unified Modeling Language) : ภาษาใช้แสดงแบบจำลองการทำงานของระบบ หรือโปรแกรม - JAVA Applet : โปรแกรมที่ถูกนำไปใช้ทำงานใน web browser - JAVA Application : โปรแกรมที่ทำงานด้วยตนเองเหมือนภาษาระดับสูง เช่น C++ หรือ VB - Servlets : โปรแกรมที่นำไปใช้ทำงานบนเว็บเซิร์ฟเวอร์ เพื่อเป็นแม่ข่ายของแต่ละเว็บไซต์ - JRE (Java Runtime Environment) : ส่วนสนับสนุนให้ Java สามารถทำงานได้ - public : คำใช้ประกาศ method ให้ class หรือ method อื่น เรียกไปใช้ได้ - static : คำใช้ประกาศตัวแปร หรือ object ถ้าประกาศตัวแปรต้องประกาศในระดับ class ถ้าไม่กำหนด static ให้ตัวแปร จะไม่สามารถใช้ตัวแปรใน object ที่ประกาศแบบ static ได้ ส่วนการประกาศ static ให้ object จะหมายถึงการไม่ยอมให้สร้าง object ลูกอีก - void : คำใช้ประกาศ method โดยไม่มีการส่งค่าใด ๆ คืน - JBuilder : editor for JAVA ( Tutorial by Michael J. Donahoo ) - Reserve Words หรือ Keywords : คำนำไปสร้างเป็นตัวแปร หรือชื่อ class ไม่ได้ |