This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); | |
| System.out.println("첫번째 피연산자를 입력하세요"); | |
| int first = sc.nextInt(); | |
| System.out.println("연산자를 입력하세여"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner scanner = new Scanner(System.in); | |
| int n = scanner.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Car { | |
| public static void main(String[] args) { | |
| String model = "포르셰"; | |
| int location = 0; | |
| Scanner sc = new Scanner(System.in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Driver dany = new Driver(); | |
| Car porche = new Car(); | |
| while (true){ | |
| dany.actionChoice(porche.getLocation(), porche); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Person { | |
| protected String name; | |
| //0이면 남자, 1이면 여자 | |
| protected int gender; | |
| protected int height; | |
| //yyyyMMdd | |
| protected String birth; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class Car { | |
| public abstract void sound(); | |
| } | |
| public class Benz extends Car { | |
| private String name = "benz"; | |
| private String color = "black"; | |
| @Override | |
| public void sound() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Main.java | |
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[]args) { | |
| Scanner scanner = new Scanner(System.in); | |
| boolean isLogin = false; | |
| User loginUser = new User(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PredicateParameter { | |
| public static void main(String [] args){ | |
| //빨갛고 무거운 사과를 얻겠다면 | |
| List<Apple> apples = new ArrayList<>(); | |
| List<Lemon> lemons = new ArrayList<>(); | |
| List<String> words = new ArrayList<>(); | |
| filter(apples, (Apple apple) -> "red".equals(apple.getColor()) && apple.getWeight()>150); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Apple{ | |
| private String color; | |
| private Integer weight; | |
| public void setColor(String color) { | |
| this.color = color; | |
| } | |
| public void setWeight(Integer weight) { | |
| this.weight = weight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //필터 적용 전 | |
| @PostMapping("/table") | |
| public List<ProfitTable> table(String selected) throws IOException{ | |
| List<Profit> profits; | |
| if(selected == null || "all".equals(selected)){ | |
| profits = profitService.findAll(); | |
| } else { | |
| profits = profitService.findByCoin(selected); | |
| } |
OlderNewer