SuperA super keyword refers to a parent class. Attaching () with super keyword means the constructor of the parent class. This ensures that no errors occur even if the default constructor for the parent class is lost. Example Code I1234567891011121314151617181920212223242526272829303132333435class Calculator { int a, b; public Calculator(){} //하위클래스가 호출될 때 자동으로 부모클래스의 생성자가 호출 //매개변수가 없는 기본생성자가 없..
Inheritance 상속 Inheritance in Java, it allows that a child class can acquire the features from a parent class, to avoid duplicate code and it is easy to maintain the program. 다른 클래스의 기능을 사용하고 싶을때 상속을 통해서 자식 클래스가 부모클래스의 기능을 그대로 사용할 수 있다. 그로인해 코드의 중복을 피할 수 있고 유지보수 또한 편리해지는 장점(하나가 변하면 다른 쪽도 자동으로 영향을 받기에)을 얻을 수 있다. extends keyword syntax class Bird extends Animal -> Class Bird inherits its super cla..
Constructor 1. A constructor has no return value, not even void. Constructor actually initializes the object of the class. If there is a return value, it would create an unexpected object. 첫번째, 생성자는 반환형이 선언되어 있지도, 반환형이 있지도 않다. 2. the Constructor name is the same as the class name. 두번째, 클래스의 이름과 동일하다. 3. the constructor can be overloaded여러개의 생성자가 존재할 수 있다. 4. if there is no constructor, a default..
Nested If-Else To avoid duplicated conditions and to make decisions in your program, the nested structure could be considered as a big frame of the program using If-Else statement. if else 로 문제를 접근할 때 중복조건을 피하고 우선순위를 정하기 위해 상위 하위에 속하는 구조(nested If-Else)를 먼저 파악한 후 틀을 잡고 문제를 해결 해 나갈 것! Q. Given an integer, , perform the following conditional actions:If is odd, print WeirdIf is even and in the incl..
OOP(Object Oriented Programming) 실제 존재하는 사물과 그에 따르는 행동을 3인칭 관찰자의 시점으로 실체화(=객체화) 시키는 형태의 프로그래밍. 수정과 유지보수에 용이 (대규모 프로젝트에 사용되기 적합) Object 객체는 데이터와 기능으로 이루어져 있다. instance 객체는 어떤 클래스에 실제하는 물건이라는 의미에서 instance라고 한다. 그렇기에 그것을 생성하는 행위를 인스턴스화(instantiation) 라고 한다. 객체를 생성할 때는 Class라는 틀이 있어야한다. 정의한 클래스를 실체화시키는 것이 객체화 시키는 것이다. *Class 특정한 유형의 객체를 구별하여 정의한 것을 가지고 있다. 틀(mold) e.g 붕어빵틀, Apple class, etc 붕어빵 틀만으..
Main method the main method is the first method when we learn Java to print "Hello World". It's the entry point of Java program. The syntax is fixed and can't be changed. Only the name of the String. for instance, you can change args below. public static void main(String[] args) public Java runtime 이 이 메소드를 실행 할 수 있도록 public 으로 설정 static인스턴스화 하지 않아도 static메서드는 호출가능 voidmain method 는 return type이..
- Total
- Today
- Yesterday
- easy algorithm
- math.max
- spring boot application
- hackerrank
- HashMap
- rest parameter
- math.abs
- Collection Framework
- easy javascript algorithm
- Javascript Algorithm
- algorithm
- hackerrank javascript
- repeat()
- 프로그래머스
- 알고리즘
- java
- javascript
- string class in java
- compareTo()
- 프로그래머스 알고리즘문제
- 프로그래머스 알고리즘
- HackerRank Algorithm
- substring()
- ... in Javascript
- equals()
- Object type casting
- C++
- code refactoring
- hackerrank javascript solution
- hackerrank solution
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |