TAILIEUCHUNG - Java™ How to Program ( Deitel - Deitel) - Phần 10

Tham khảo sách 'java™ how to program ( deitel - deitel) - phần 10', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | PREV NEXT Page 221 Summary The for repetition statement specifies the details of counter-controlled-repetition. The general format of the for statement is for initialization loopContinuationCondition increment statement where the initialization expression names the loop s control variable and provides its initial value loopContinuationCondition is the condition that determines whether the loop should continue executing and increment modifies the control variable s value so that the loopcontinuation condition eventually becomes false. Typically for statements are used for counter-controlled repetition and while statements are used for sentinel-controlled repetition. Page 222 The scope of a variable defines where it can be used in a program. For example a local variable can be used only in the method that declares the variable and only from the point of declaration through the end of the method. The initialization loop-continuation condition and increment portions of a for statement can contain arithmetic expressions. The increment of a for statement may also be negative in which case it is really a decrement and the loop counts downward. If the loop-continuation condition in a for header is initially false the program does not execute the for statement s body. Instead execution proceeds with the statement following the for. The format specifier 20s outputs a string with a field width of 20 . at least 20 character positions . If the value to be output is less than 20 character positions wide the value is right justified in the field by default. A value can be output left justified by simply preceding the field width with the minus sign formatting flag. Methods that perform common tasks and do not require objects are called static methods. Java does not include an exponentiation operator. Instead x y can be used to calculate the value of x raised to the y th power. The method receives two double arguments and returns a double value. The comma formatting .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.