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

1. Class

1.1. What Is

1.1.1. A class defines the properties and behaviors for objects.

1.1.2. Programmer-difined type

1.2. >> template defines object’s data fields and methods >> non-static parts of classes describe objects

1.2.1. Objects

1.2.1.1. Declare syntax: ClassName objectRefVar;

1.2.1.2. Declaration - Creation - Assigning syntax: ClassName objectRefVar = new ClassName();

1.2.1.3. Object's members accessing

1.2.1.3.1. objectRefVar.dataField

1.2.1.3.2. objectRefVar.method(arguments)

1.3. Generic Syntax: modifier class ClassName <extends SuperClass implement Intreface> { // field, constructor, and // method declarations }

1.3.1. Class Header

1.3.1.1. modifier

1.3.1.1.1. public

1.3.1.1.2. protected

1.3.1.1.3. default

1.3.1.1.4. private

1.3.1.1.5. abtract

1.3.1.2. Class Abtraction

1.3.1.3. ClassName

1.3.1.4. extends SuperClass

1.3.1.5. implement Interface

1.3.2. Data Fields

1.3.2.1. Syntax: modifier datatype dataFieldName;

1.3.2.1.1. modifier

1.3.2.2. Data Encapsulation private datatype dataFieldName;

1.3.2.2.1. Properties

1.3.2.2.2. Accessor

1.3.2.2.3. Mutator

1.3.2.3. static Variable

1.3.2.3.1. Tips & Tricks

1.3.2.4. instance Variable

1.3.2.5. Default values

1.3.2.5.1. reference type: null

1.3.2.5.2. numeric: 0

1.3.2.5.3. boolean: false

1.3.2.5.4. char: \u0000

1.3.2.5.5. no default value to a local variable inside a method

1.3.3. Method

1.3.3.1. Instance method

1.3.3.1.1. Tips & Tricks

1.3.3.2. Static method

1.3.3.2.1. Tips & Tricks

1.3.3.3. Syntax: modifier returnValueType methodName(list of parameters) { // Method body; }

1.3.3.3.1. modifier

1.3.3.3.2. returnValueType

1.3.3.3.3. methodName

1.3.3.3.4. parameters (agrs)

1.3.3.3.5. method body

1.3.4. Constructor

1.3.4.1. properties

1.3.4.1.1. same name its Class

1.3.4.1.2. special kind of method

1.3.4.1.3. don't have return type (not even VOID)

1.3.4.1.4. can be overloaded (agrs optional)

1.3.4.1.5. don't belong to objects

1.3.4.2. Syntax: modifier ClassName(arguments) { // block of statements }

1.3.4.2.1. modifier

1.3.4.2.2. arguments

1.3.4.3. invoke Contructor to create Object syntax: new ClassName(arguments);

1.3.4.3.1. computer gets a block of unused memory in the heap

1.3.4.3.2. initializes the instance variables of the object

2. Modifiers

2.1. Visibility modifiers

2.1.1. public

2.1.2. default

2.1.3. protected

2.1.4. private

2.1.4.1. methods and data fields accessible only from within its own class