Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- DS
- Algorithm
- function
- github
- while
- DATAPATH
- javascript
- MIPS
- mysql
- react
- Linux
- DoM
- architecture
- Java
- XML
- CSS
- python
- system
- for
- computer
- DB
- data structure
- Class
- control
- MacOS
- instruction
- Pipelining
- php
- html
- web
Archives
- Today
- Total
목록Conditional (1)
YYYEJI
[JAVA] 조건부 연산자(Conditional operator)
조건부 연산자(Conditional operator)란? If-else 문을 간결하게 해 놓은 코드입니다. Variable_name = (Boolean_Expression) ? Result1 : Result2 ; public static void main(String[] args) { int num = 2; System.out.print("The number is " + ((num%2==0) ? "positive" : "negative")); } 조건문에 맞춰서 결과가 true이면 Result1, 결과가 false이면 Result2가 실행됩니다. ◡̈
Java
2022. 12. 24. 17:46