Get Started. It's Free
or sign up with your email address
JAVA by Mind Map: JAVA

1. Class

1.1. ตัวแปร variable

1.1.1. ลักษณะของตัวแปร

1.1.1.1. 1.accessibility

1.1.1.1.1. Defeat

1.1.1.1.2. public

1.1.1.1.3. private

1.1.1.1.4. protected

1.1.1.2. 2.modifier

1.1.1.2.1. Static

1.1.1.2.2. non-static

1.1.1.3. 3.data type ประเภท

1.1.1.3.1. int

1.1.1.3.2. double

1.1.1.4. 4.assign value การกำหนดค่า

1.1.1.4.1. public static int a=2;

1.1.2. ตำแหน่งของตัวแปร

1.1.2.1. 1. local

1.1.2.1.1. create local variable 'x'

1.1.2.2. 2. field

1.1.2.2.1. create field 'x'

1.1.2.3. 3. field in type

1.1.2.3.1. create field 'x' in type 'MainActivity'

1.1.2.4. 4. class/parameter

1.1.2.4.1. Create parameter 'x'

1.2. method

1.2.1. ลักษณะของเมธอด

1.2.1.1. 4ลักษณะ

1.2.1.1.1. 1.accessibility

1.2.1.1.2. 2.modifier => static/non-static

1.2.1.1.3. 3.void return

1.2.1.1.4. 4.รับ/ไม่รับค่าพารามิเตอร์

1.2.2. constructor method

1.2.2.1. 1. คือเมธอดที่ชื่อเดียวกับคลาส

1.2.2.2. 2. การเรียกใช้ constructor method

1.2.2.2.1. 1.เพื่อสร้าง object Class1 c1=new Class();

1.2.2.2.2. 2. เพื่อสั่งให้กำหนดค่าเริ่มต้น new class();

1.2.2.3. 3. ถ้ามีมากกว่า 1 คอนสตักเตอร์ การรับค่าพารามิเตอร์ต้องไม่เหมือนกัน (overloading constructor)

1.2.3. ประเภทของเมธอด

1.2.3.1. 1. life cycle (main , oncreate) สั่งทำงาน

1.2.3.2. 2. ธรรมดา มี body

1.2.3.3. 3. abstract มีแต่ชื่อ

1.2.3.4. 4. constructor ชื่อเดียวกับคลาส

1.3. ประเภทของคลาส

1.3.1. 1. มี main,oncreate

1.3.1.1. 1. ตัวแปร

1.3.1.2. 2. method (function)

1.3.1.3. 3. ,มี Main, oncreate

1.3.2. 2. ไม่มี main

1.3.3. 3. abstract class

1.3.3.1. 1. method ธรรมดา

1.3.3.2. 2. abstract method

1.3.4. 4. interface class

1.3.4.1. 1. abstract method