λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
Programming/Java

4 Operation (μ—°μ‚°)

by Dowon Kang 2023. 12. 30.

 

μžλ°”μ—μ„œ μ—°μ‚°μž(Operators)λŠ” ν”„λ‘œκ·Έλž¨μ—μ„œ λ³€μˆ˜λ‚˜ κ°’λ“€ κ°„에 μˆ˜ν–‰λ˜λŠ” λ™μž‘을 λ‚˜νƒ€λƒ…λ‹ˆλ‹€. μ—°μ‚°μžλŠ” νŠΉμ •ν•œ μ—°μ‚°μ„ μˆ˜ν–‰ν•˜κ±°λ‚˜ κ°’을 μ‘°μž‘ν•˜λŠ” λ° μ‚¬μš©λ©λ‹ˆλ‹€. 

μ—°μ‚°μžλŠ” ν”Όμ—°μ‚°μž(Operands)라 λΆˆλ¦¬λŠ” ν•˜λ‚˜ μ΄μƒμ˜ κ°’을 ν•„μš”λ‘œ ν•˜λ©°, ν”Όμ—°μ‚°μžμ™€ μ—°μ‚°μž κ°„μ˜ μ‘°ν•©μœΌλ‘œ ν‘œν˜„식을 ν˜•μ„±ν•©λ‹ˆλ‹€.

 

μ—°μ‚°μžμ˜ μ—¬λŸ¬κ°€μ§€ μ’…λ₯˜ 

1. 증감 μ—°μ‚°μž (Increment, Decrement Operators)

증가 λ° κ°μ†Œ μ—°μ‚°μžλŠ” λ°˜λ³΅λ¬Έμ—μ„œ μžμ£Ό μ‚¬μš©λ˜λ©°, λ³€μˆ˜μ˜ κ°’을 μ¦κ°€μ‹œν‚€κ±°λ‚˜ κ°μ†Œμ‹œν‚¬ λ•Œ νŽΈλ¦¬ν•˜κ²Œ ν™œμš©ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ μ‚¬μš©ν•  λ•Œ μ£Όμ˜κ°€ ν•„μš”ν•˜λ©°, νŠΉνžˆ λ‹€λ₯Έ μ—°μ‚°μžμ™€ ν•¨κ»˜ μ‚¬μš©λ  λ•Œ μš°μ„ μˆœμœ„에 μ£Όμ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€.

 

2. μ‚°μˆ  μ—°μ‚°μž (Arithmetic Operators)

λ§μ…ˆ, λΊ„μ…ˆ, κ³±μ…ˆ, λ‚˜λˆ—μ…ˆ, λ‚˜λ¨Έμ§€ λ“±μ˜ μˆ˜ν•™μ  연산을 μˆ˜ν–‰ν•©λ‹ˆλ‹€.

 

 

3. 비ꡐ μ—°μ‚°μž (Comparison Operators)

κ°’λ“€ κ°„μ˜ λΉ„ꡐλ₯Ό μˆ˜ν–‰ν•˜λ©°, κ²°κ³ΌλŠ” μ°Έ(true) λ˜λŠ” κ±°μ§“(false)μž…λ‹ˆλ‹€.

 

 

4. 논리 μ—°μ‚°μž (Logical Operators)

논리 연산을 μˆ˜ν–‰ν•˜λ©°, 주둜 μ‘°κ±΄λ¬Έμ—μ„œ μ‚¬μš©λ˜μ–΄ 쑰건의 μ°Έκ³Ό 거짓을 κ²°μ •ν•©λ‹ˆλ‹€.

 

 

5. λŒ€μž… μ—°μ‚°μž (Assignment Operators)

λ³€μˆ˜μ— 값을 ν• λ‹Ήν•˜λŠ” 데 μ‚¬μš©λ˜λ©°, ν• λ‹Ήλœ 값을 λ°˜ν™˜ν•©λ‹ˆλ‹€.

 

 

6. μ‚Όν•­ μ—°μ‚°μž (Ternary Operator)

μ„Έ 개의 ν”Όμ—°μ‚°μžλ₯Ό 가지며, 쑰건에 따라 값을 λ°˜ν™˜ν•©λ‹ˆλ‹€.

 

 

 


An operation refers to a specific action or calculation performed on data.

 

Increment and Decrement Operators: Increase or decrease the value of a variable.

 

Arithmetic Operators: Perform mathematical operations such as addition, subtraction, multiplication, division, and remainder.

Comparison Operators: Perform comparisons between values, and the result is either true or false.

Logical Operators: Execute logical operations, commonly used in conditional statements to determine the truth or falsehood of conditions.

Assignment Operators: Used to assign values to variables and return the assigned value.

Ternary Operator: Takes three operands and returns a value based on a condition.

'Programming > Java' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

6 for loop (feat. Nested, foreach)  (0) 2024.01.07
5 If & Switch (feat. break, continue)  (0) 2024.01.07
3 Casting  (0) 2023.12.29
2 Variable, Constant and Primitive Type in Java (Feat. Literal)  (0) 2023.12.29
1 JVM, JRE, JDK  (0) 2023.12.28

λŒ“κΈ€