티스토리 뷰
Constructor and Destructor with simple example code
- Constructors are called as soon as an object is created
- It does not have a return type and has the same name as class name.
- In case there is no constructor or destructor, the compiler creates default constructor or destructor but if there is at least one constructor, the default constructor is not created by default.
- They both have to be public.
- A class allows multiple constructors but destructor must be the one.
example code
Result
'C++' 카테고리의 다른 글
Copy constructor(Deep copy, Shallow copy) in C++ (0) | 2018.11.09 |
---|---|
Inheritance and Overriding in C++ with simple example (0) | 2018.11.07 |
Encapsulation (getters and setters) in C++ (0) | 2018.11.06 |
Reference in C++ (0) | 2018.11.06 |
Class and Object in C++ (0) | 2018.11.06 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- repeat()
- hackerrank javascript solution
- 알고리즘
- rest parameter
- 프로그래머스 알고리즘
- 프로그래머스
- HackerRank Algorithm
- ... in Javascript
- hackerrank
- spring boot application
- easy javascript algorithm
- equals()
- java
- Collection Framework
- 프로그래머스 알고리즘문제
- javascript
- hackerrank solution
- substring()
- algorithm
- math.max
- code refactoring
- hackerrank javascript
- Object type casting
- easy algorithm
- math.abs
- HashMap
- string class in java
- Javascript Algorithm
- compareTo()
- C++
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 |
30 |
글 보관함