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

1. ตัวแปร variable

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

1.1.1. accessibility

1.1.1.1. default(ไม่เขียน)

1.1.1.2. public

1.1.1.3. private

1.1.1.4. protected

1.1.2. modifier

1.1.2.1. static

1.1.2.2. non Static

1.1.3. data type ประเภท

1.1.3.1. int

1.1.3.2. double

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

1.1.4.1. public,static,int a=2

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

1.1.5.1. local

1.1.5.2. field

1.1.5.3. field in type...{class}

1.1.5.4. parameter

2. method

2.1. มี 4 ลักษณะ

2.1.1. accessibility

2.1.2. modifiler

2.1.2.1. => static/non-static

2.1.3. void return

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

3. Constructor method

3.1. method ที่ชื่อเดียวกับ Class

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

3.2.1. เพื่อสร้าง Object Class1 c1=new Class1();

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

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

4. ประเภทของ Class

4.1. 1. มี main,oncreate

4.2. 2. ไม่มี main

4.3. 3. abstract

4.3.1. method ธรรมดา

4.3.2. abstract method

4.4. 4. interface

4.4.1. abstract method

5. ประเภทของ method

5.1. 1. life cycle (main,oncreate)

5.2. ธรรมดา มี Body

5.3. abstract มีแต่ชื่อ

5.4. constructor ชื่อเดียวกับ Class

6. Class มี main oncreate เรียก method ของ Class อื่นมาทำงาน วิธีสร้าง Object ของ Class

6.1. Class ธรรมดา c2

6.2. Abstract Class (implement abstract method เข้ามา) c3

6.3. interface Class (implement abstract method เข้ามา) c4

6.4. วิธีที่ 2

6.4.1. ธรรมดา ใช้ extends

6.4.2. Abstract Class ใช้ extends จะ implement abstract method เข้ามา

6.4.3. interface Class ใช้ implement จะ implement abstract method เข้ามา