예외처리 (Exception handling) 은 프로그램의 논리에 벗어난 에러인 runtime error를 발견하도록 도와준다. - 사용자정의 exception handling 이 아닌 자바에 자체적으로 내장되어있는 에러클래스의 경우 (e.g. ArithmeticException) 사용자가 새롭게 객체를 정의하지 않아도 JVM에 의해 생성된 인스턴스의 참조값이 전달된다. import java.util.Scanner; class Main{ public static void main(String[] args){ System.out.print("Enter two digits: "); Scanner keyboard = new Scanner(System.in); int num1 = keyboard.nextInt..
Upcasting을 이용하면 부모객체로 부터 상속받은 메서드를 사용할 수 있게된다. 즉, 단 하나의 부모클래스의 객체(PhoneInfo)로 여러가지 자식 메서드(univPhoneInfo, companyPhoneInfo, friendPhoneInfo)를 검색할 수 있는 장점이 있다. Example I public class PhoneInfo { String name; String phoneNum; public PhoneInfo(String name, String num){ this.name = name; phoneNum = num; } public void showInfo(){ System.out.println("name: " + name); System.out.println("phone: " + phon..
@Getter @NoArgsConstructor @AllArgsConstructor public class TravelDto { @NotEmpty @Column(name = "startDate") private String startDate; @NotEmpty @Column(name = "endDate") private String endDate; @NotEmpty @Column(name = "country") private String country; @NotEmpty @Column(name = "city") private int city; @Column(name = "NumOfPeople") private String NumOfPeople; @Column(name = "age") private Str..
There are two different way to inject spring beans using @Autowired and Constructor. When it comes to using a constructor to inject a bean, Lombok is a useful way to reduce some boilerplate code. However, if fields order within a method is changed, parameters order also would be changed, so that error would occur. You can use the constructor instead of @Autowired to prevent the error. @Autowired..
Creating MySQL database through terminal When your root password is generated/usr/local/mysql/bin/mysql -uroot -pWhen the password is not generated/usr/local/mysql/bin/mysql -uroot Enter your mysql password To check your databasesSHOW DATABASES;To create a databaseCREATE DATABASE 'the name of database';To check the created databaseSHOW DATABASES;To quitQUIT;
- Total
- Today
- Yesterday
- easy javascript algorithm
- hackerrank javascript
- hackerrank javascript solution
- hackerrank
- algorithm
- rest parameter
- Object type casting
- java
- HackerRank Algorithm
- 프로그래머스 알고리즘
- compareTo()
- easy algorithm
- C++
- math.abs
- code refactoring
- javascript
- math.max
- Javascript Algorithm
- 프로그래머스
- ... in Javascript
- substring()
- equals()
- Collection Framework
- 알고리즘
- hackerrank solution
- HashMap
- spring boot application
- string class in java
- repeat()
- 프로그래머스 알고리즘문제
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |