본문 바로가기

Java 배우기145

The if-then and if-then-else Statements if-then 및 if-then-else 명령문 if-then 및 if-then-else 명령문 The if-then and if-then-else Statementsif-then 명령문 The if-then Statement The if-then statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true. For example, the Bicycle class could allow the brakes to decrease the bicycle's speed only if the bicycle is already i.. 2016. 1. 5.
Control Flow Statements 컨트롤 흐름 명령문 컨트롤 흐름 명령문 Control Flow Statements 소스 파일 내부의 명령문은 일반적으로 나타난 순서대로 위에서 아래로 실행됩니다. 하지만 제어 흐름 명령문(Control flow statements)은, 특정 블록의 코드를 조건부로 실행할 수 있게 하면서, 의사결정 채택, 루핑 및 분기에 의하여 실행의 흐름을 종료시킵니다. 이 섹션에서는 자바 프로그래밍 언어가 지원하는, 의사-결정 명령문(if-then, if-then-else, switch), 루프 명령문(for, while, do-while), 그리고 분기 명령문 (break,continue, return)을 설명합니다. The statements inside your source files are generally executed fro.. 2016. 1. 5.
Questions and Exercises: Expressions, Statements, and Blocks Questions and Exercises: Expressions, Statements, and BlocksQuestionsOperators may be used in building ___, which compute values.Expressions are the core components of ___.Statements may be grouped into ___.The following code snippet is an example of a ___ expression. 1 * 2 * 3 Statements are roughly equivalent to sentences in natural languages, but instead of ending with a period, a statement e.. 2016. 1. 5.
Expressions, Statements, and Blocks Expressions, Statements, and Blocks 변수와 연산자를 이해했으니, expressions, statements, blocks에 대해 배워야 합니다. expressions를 구축할 때 연산자가 사용되는데, 연산자는 값을 계산합니다; expressions은 statements의 핵심 구성요소입니다; statements는 블록으로 그룹화될 수 있습니다. Now that you understand variables and operators, it's time to learn about expressions, statements, and blocks. Operators may be used in building expressions, which compute values; expressi.. 2016. 1. 5.
Questions and Exercises: Operators Questions and Exercises: OperatorsQuestionsConsider the following code snippet.arrayOfInts[j] > arrayOfInts[j+1] Which operators does the code contain?Consider the following code snippet.int i = 10; int n = i++%5; What are the values of i and n after the code is executed?What are the final values of i and n if instead of using the postfix increment operator (i++), you use the prefix version (++i.. 2016. 1. 5.
Summary of Operators Summary of Operators The following quick reference summarizes the operators supported by the Java programming language. Simple Assignment Operator= Simple assignment operator Arithmetic Operators+ Additive operator (also used for String concatenation) - Subtraction operator * Multiplication operator / Division operator % Remainder operator Unary Operators+ Unary plus operator; indicates positive.. 2016. 1. 5.