본문 바로가기 메뉴 바로가기

Studying programming

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Studying programming

검색하기 폼
  • Jimin's Programming (194)
    • Algorithms (54)
    • JavaScript (16)
    • Vue.js (3)
    • Node.js (3)
    • React.js (7)
    • React Native (0)
    • Spring Boot (13)
    • JAVA (58)
    • C++ (17)
    • Programming (19)
    • Computer basics (4)
  • 방명록

JAVA (58)
instanceof keyword

instanceof A instanceof B -> Is A subtype of B? class Taxi extends Car class Bus extends Car Taxi instanceof Car // true - Taxi extends Car Car instanceof Bus // false - Bus extends Car

JAVA 2019. 7. 11. 03:52
Overriding hasCode() and equals() in Java

hashCode() and equals() - 서로 다른 객체는 각자 다른 주소값을 가지고 있기에 각자의 hashCode를 가지게 된다. - equals()는 최상위 Object class에 속해 있어서 Java Class들이 overriding 하는 것이 가능. - primitive type은 내용이 같은지 reference 는 가리키는 주소가 같은지 비교해주는데 overriding을 통해서 이 점을 수정가능. - HashSet의 equals()는 내용이 동일하면 true를 반환 - HashSet의 add()는 데이터의 입력이 가능(hashSet에 동일한 data가 존재하지 않는다)하면 true, 요소가 이미 존재하면 false를 반환 - equals() 만 overriding 할 경우 같은 내용이지만..

JAVA 2019. 7. 11. 03:43
Singleton pattern (Java design pattern)

Singleton pattern It creates only one instance of a class, not allow to create a 2nd instance. How to create a Singleton pattern 1. Create a 'static' object of a class 2. Create private constructor to prevent that a user creates an instance with a default constructor. ※ The default constructor is called when an instance is created. the default constructor is public by default. 3. Create a 'stati..

JAVA 2019. 7. 10. 05:20
Scanner nextInt(), nextLine()

A user types 'integer value' and 'Enter', but nextInt() does not use the end of the input, which is 'Enter' so that it leaves in the buffer. If nextLine() is used after nextInt(), the remainder causes an error. Because nextLine() is the method that reads data until the 'Enter' input. To remove the last input(Enter), simply use nextLine() to terminate the line. nextInt()메서드 다음에 nextLine()메서드가 온다면..

JAVA 2019. 7. 10. 02:49
Write to file in Java - double output using BufferedWriter

Simply use String.format(,) to format double output using BufferdWrite. Example output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file.getPath()), StandardCharsets.UTF_8)); output.write("Total Average: " + "\t" + "\t" + String.format("%.2f",average) + "%" + "\n" + "\n");

JAVA 2019. 7. 8. 03:51
File I/O - Decorator pattern, File.separator

Decorator pattern BufferedReader sc = new BufferedReader(new FileReader("src" + File.separator + "csv_input" + File.separator + "students.csv")); We have various methods to choose for File I/O such as FileReader, BufferdReader, BufferedWriter, PrintWrite etc. The decorator pattern allows applying more than one method for File I/O without altering. File.separator File.separator enables to work on..

JAVA 2019. 7. 5. 08:02
이전 1 2 3 4 5 6 7 ··· 10 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • java
  • substring()
  • HackerRank Algorithm
  • C++
  • 프로그래머스 알고리즘
  • math.abs
  • spring boot application
  • ... in Javascript
  • string class in java
  • compareTo()
  • code refactoring
  • 알고리즘
  • algorithm
  • Object type casting
  • easy javascript algorithm
  • HashMap
  • hackerrank javascript
  • 프로그래머스 알고리즘문제
  • math.max
  • easy algorithm
  • hackerrank javascript solution
  • javascript
  • rest parameter
  • Javascript Algorithm
  • equals()
  • hackerrank solution
  • 프로그래머스
  • Collection Framework
  • hackerrank
  • repeat()
more
«   2025/12   »
일 월 화 수 목 금 토
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 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바