본문 바로가기

Programming137

[Java 기초문법] Streams API | Streams, stream의 다양한 메소드, sum, sort, filter [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy Streams 이와 같은 텍스트를 가져올 때 streams of strings으로 가져오는 것을 보자. forEach => Consumer라고 하는 functional interface를 입력하도록 요구 peopleText.lines() .forEach(System.out::println); 하나씩 가져오는 것을 볼 수 있다. what's happening here is that this line's method is returning a stream of strings, which are the individual line, each string is b.. 2022. 10. 20.
[Java 기초문법] collections, list, linked list, looping with iterators [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy Collections 자바에서 Collections은 object를 store하는 형식을 말한다. List, Set, Queue, Deque로 구분되고 별도로 Map이 존재한다. Colletions의 특징은 dynamic 변경이 가능하다는 점이다. And also the entire collecionts API of Java is heavily predicated on the use and knowledge of interfaces. Lists Lists are intended to allow us to store objects in order. List .. 2022. 10. 20.
[Java 기초문법] 자바 람다 Lambdas, delegate method [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy Lambdas public static final Employee createEmployee(String employeeText){ Matcher peopleMat = Employee.PEOPLE_PAT.matcher(employeeText); if (peopleMat.find()) { return switch (peopleMat.group("role")){ case "Programmer" -> new Programmer(employeeText); case "Manager" -> new Manager(employeeText); case "Analyst" -.. 2022. 10. 20.
[Java 기초문법] 자바 records [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy 자바 프로그래머라면 일반적으로 시작할 때 fields를 추가하고 1개의 constructor와 getters and setters를 각각 깔고 시작을 하는 경향이 있다. 그렇다면 왜 이런 starting point가 필요한가에 대한 의문이 생겨난다. import java.time.LocalDate; import java.util.Objects; public class Weirdo { private String lastname; private String firstname; private LocalDate dob; public Weirdo() { } publ.. 2022. 10. 20.
[Java 기초문법] 자바 객체지향 | OOP, Interfaces, Super class, Abstract class, Factory Methods, Nested class, inner class [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy More Advanced OOP Topics 시작 데이터를 regex로 파싱해서 정보를 뽑아내는 다음과 같은 코드가 있다고 치자. package com.neutrio.employee; import java.text.NumberFormat; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { String peopleText = """ Flinstone, Fred, 1/1/1990, Prog.. 2022. 10. 20.