- Java Fundamentals
- Gazihan Alankus Rogério Theodoro de Brito Basheer Ahamed Fazal Vinicius Isola Miles Obare
- 230字
- 2021-06-11 13:37:56
Introduction
So far, we have looked at programs that consist of a series of statements that the Java compiler executes sequentially. However, in certain cases, we might need to perform actions based on the current state of the program.
Consider the example of the software that's installed in an ATM machine – it performs a set of actions, that is, it allows a transaction to occur when the PIN that's been entered by the user is correct. However, when the PIN that's been entered is incorrect, then the software performs another set of actions, that is, it informs the user that the PIN does not match and asks the user to reenter the PIN. You'll find that such logical constructs that depend upon values or stages are present in almost all real-world programs.
There are also times where a particular task might need to be performed repeatedly, that is, for a particular time duration, for a particular set number of times, or until a condition is met. Continuing from our example of the ATM machine, if the number of times an incorrect password is entered exceeds three, then the card is blocked.
These logical constructs act as building blocks, as we move toward building complex programs in Java. This lesson will dive into these basic constructs, which can be categorized into two general classes, as follows:
- Conditional statements
- Looping statements
- Drupal 8 Blueprints
- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程
- Vue.js 2 and Bootstrap 4 Web Development
- RTC程序設(shè)計(jì):實(shí)時(shí)音視頻權(quán)威指南
- Java程序設(shè)計(jì)與計(jì)算思維
- 軟件架構(gòu):Python語言實(shí)現(xiàn)
- Bootstrap 4:Responsive Web Design
- 零基礎(chǔ)輕松學(xué)SQL Server 2016
- Python Data Analysis Cookbook
- Python圖形化編程(微課版)
- Spring Boot實(shí)戰(zhàn)
- Hands-On Kubernetes on Windows
- Arduino電子設(shè)計(jì)實(shí)戰(zhàn)指南:零基礎(chǔ)篇
- Developing Java Applications with Spring and Spring Boot
- Getting Started with the Lazarus IDE