'Back-End/Java_1'에 해당되는 글 48건

donaricano-btn

Aggregation in java

- If a class have an entity reference, It is known as Aggregation


1. Why use Aggregation

- For code Reuseability


2. Example

1) Address.java


2) Emp.java

 

'Back-End > Java_1' 카테고리의 다른 글

[Java] Overloading vs Overriding  (0) 2016.08.24
[Java] Method Overriding  (0) 2016.08.24
[Java] Inheritance in Java  (0) 2016.08.23
[Java] Input by Console  (0) 2016.08.23
[Java] Input by BufferedReader  (0) 2016.08.22
블로그 이미지

리딩리드

,
donaricano-btn

Inheritance in Java

- Inheritance is a mechanism in which on object acquires all the properties and behaviors of parent object

- For method Overriding(so runtime polymorphism can be achieved)

- For code reusability


1. Example



2. Why multiple inheritance is not supported in java?

- To reduce the complexity and simplify the language



'Back-End > Java_1' 카테고리의 다른 글

[Java] Method Overriding  (0) 2016.08.24
[Java] Aggregation in java  (0) 2016.08.23
[Java] Input by Console  (0) 2016.08.23
[Java] Input by BufferedReader  (0) 2016.08.22
[Java] Input by Scanner  (0) 2016.08.18
블로그 이미지

리딩리드

,
donaricano-btn

Input by Console

- The Java Console class is used to get input from console

- It provides methods to read text and password

- If you read password using console, it will not be displayed to the user


1. Method of Console class

2. Example


'Back-End > Java_1' 카테고리의 다른 글

[Java] Aggregation in java  (0) 2016.08.23
[Java] Inheritance in Java  (0) 2016.08.23
[Java] Input by BufferedReader  (0) 2016.08.22
[Java] Input by Scanner  (0) 2016.08.18
[Java] This keyword - to refer current class instance variable  (0) 2016.08.05
블로그 이미지

리딩리드

,
donaricano-btn

 Input by BufferedReader


1. Reading data from keyboard

- There are many ways to read data from keyboard

1) InputStreamReader

2) Console

3) Scanner

4) DataInputStream etc..


2. InputStreamReader class

- InputStreamReader class can be used to read data from keyboard. It performs two tasks

1) connects to input stream of keyboard

2) converts the byte-oriented stream into character-oriented stream


3. BufferedReader class

- BufferedReader class can be used to read data by line by readLine() method


4. Example

1) Simple


2) User can stop the program

 

'Back-End > Java_1' 카테고리의 다른 글

[Java] Inheritance in Java  (0) 2016.08.23
[Java] Input by Console  (0) 2016.08.23
[Java] Input by Scanner  (0) 2016.08.18
[Java] This keyword - to refer current class instance variable  (0) 2016.08.05
[Java] Static_2  (0) 2016.07.26
블로그 이미지

리딩리드

,