Statements A Java program is composed of statements, which define the computation
by creating and manipulating variables, assigning data-type values to them, and
controlling the flow of execution of such operations. Statements are often organized in
blocks, sequences of statements within curly braces.
■ Declarations create variables of a specifi ed type and name them with identifiers.
■ Assignments associate a data-type value (defi ned by an expression) with a variable.
Java also has several implicit assignment idioms for changing the value of a
data-type value relative to its current value, such as incrementing the value of an
integer variable.
■ Conditionals provide for a simple change in the fl ow of execution—execute the
statements in one of two blocks, depending on a specified condition.
■ Loops provide for a more profound change in the fl ow of execution—execute the
statements in a block as long as a given condition is true.
■Calls and returns relate to static methods (see page 22), which provide another way
to change the flow of execution and to organize code.
A program is a sequence of statements, with declarations, assignments, conditionals,
loops, calls, and returns. Programs typically have a nested structure : a statement among
the statements in a block within a conditional or a loop may itself be a conditional or a
loop. For example, the while loop in rank() contains an if statement. Next, we consider
each of these types of statements in turn.
Statements A Java program is composed of statements, which define the computationby creating and manipulating variables, assigning data-type values to them, andcontrolling the flow of execution of such operations. Statements are often organized inblocks, sequences of statements within curly braces.■ Declarations create variables of a specifi ed type and name them with identifiers.■ Assignments associate a data-type value (defi ned by an expression) with a variable.Java also has several implicit assignment idioms for changing the value of adata-type value relative to its current value, such as incrementing the value of aninteger variable.■ Conditionals provide for a simple change in the fl ow of execution—execute thestatements in one of two blocks, depending on a specified condition.■ Loops provide for a more profound change in the fl ow of execution—execute thestatements in a block as long as a given condition is true.■Calls and returns relate to static methods (see page 22), which provide another wayto change the flow of execution and to organize code.A program is a sequence of statements, with declarations, assignments, conditionals,loops, calls, and returns. Programs typically have a nested structure : a statement amongthe statements in a block within a conditional or a loop may itself be a conditional or aloop. For example, the while loop in rank() contains an if statement. Next, we considereach of these types of statements in turn.
การแปล กรุณารอสักครู่..

สถานะโปรแกรมที่ประกอบด้วยงบที่กำหนดในการคำนวณโดยการสร้างและจัดการกับตัวแปรที่กำหนดชนิดข้อมูลค่าเหล่านั้น และการควบคุมการไหลของการดำเนินงานดังกล่าว มักจะมีการจัดในงบบล็อก , ลำดับของข้อความภายในวงเล็บ หยิก■ประกาศสร้างตัวแปรของของเหลวประเภทเอ็ดและชื่อของพวกเขากับระบุ .■งานเชื่อมโยงค่าชนิดข้อมูล ( เดฟีเน็ดโดยการแสดงออก ) กับตัวแปรจาวาก็มีหลายสำนวน งานระบบการเปลี่ยนค่าของชนิดข้อมูลค่าสัมพัทธ์กับค่าปัจจุบันของ เช่น incrementing มูลค่าของตัวแปรจำนวนเต็ม■เงื่อนไขให้สำหรับการเปลี่ยนแปลงง่ายใน FL . การรันงบในหนึ่งสองบล็อก ขึ้นอยู่กับเงื่อนไขที่ระบุไว้■ลูปให้สำหรับการเปลี่ยนแปลงที่ลึกซึ้งมากขึ้นใน FL . การรันข้อความในบล็อกตราบใดที่เงื่อนไขที่กําหนดเป็นจริง■โทรและผลตอบแทนที่เกี่ยวข้องกับวิธีการแบบคงที่ ( ดูหน้า 22 ) ซึ่งมีอีกวิธีที่จะเปลี่ยนการไหลของการดำเนินการและการจัดระเบียบรหัสโปรแกรมเป็นลำดับของงบ ด้วยการประกาศกำหนด , เงื่อนไข , ,ลูป , สาย , และกลับมา โปรแกรมมักจะมีโครงสร้างซ้อน : แถลงการณ์ของข้อความในบล็อกภายในเงื่อนไข หรือห่วงตัวเองอาจเป็นเงื่อนไขหรือวง ตัวอย่างเช่น ในขณะที่วงในตำแหน่ง ( ) ประกอบด้วยถ้างบ ต่อไป เราจะพิจารณาแต่ละประเภทเหล่านี้ของงบในการเปิด
การแปล กรุณารอสักครู่..
