The switch statement is used to perform different actions based on different conditions. Here are some knowledge points for switch usage, and friends who are interested in switch usage learn through this article.
Switch is a toggle statement,
switch
One, save true or FALSE, use the Boolean variableThere are two values: True TrueFalse falseIi. accept input information from the console by creating a scannerScanner input New Scanner (system.in);int age input.nextint ();//Receive int typeString
1. The so-called programming is to send a command to the computer, using a paragraph, or a few commands to let the computer do what you want it to do.2. The so-called object is the object you want it to do things, just like you want Michael to buy
Return, break, and contiue are language constructs, just like an if statement, but exit is a function. 1.exit function: Output a message and terminate the current script outputs a piece of messages and terminates the active scripts. If a section of
Return, break, and contiue are language structures, just like if statements, but exit is a function. 1. function of exit: Outputamessageandterminatethecurrentscript outputs a message and terminates the current script. If a piece of text contains
Let's talk about the use of the Exit function.
Function: Outputs a message and terminates the current script.
If a text contains multiple scripts to end, exit exits the current script.
For example, a PHP text includes code, then the output is world.
Tag: The code implementation has one fill highlight than the multi-label roundSometimes the programming for a long time, if you stop to think about it, even some of the most basic knowledge points, it may also make their own circle. In fact, at the
Blocking blocked and racblocked in RAC Environment
The blocking in the RAC environment is different from that in a single instance, because we need to consider the session in different instances. That is to say, the corresponding strain of the
Plug-in function: You can add extended information to a selected text segment. When displaying a text segment, click the text segment to display the extension information on the sidebar.Development Idea: Add a label to selected text and register an
Restructuring: improving the design of existing code,
If a person has never heard of the refactoring book, he cannot say that he is a programmer. If he has never read the refactoring book, it is hard to imagine that he will be a good programmer.
Let's talk about the exit function usage first.
Purpose: Output a message and terminate the current script.
If a piece of text contains multiple ending scripts, exit from the current script.
For example, if a php text includes the code, the output
PHP from Mastery to getting started
(i) Introduction and basic knowledge of PHP
PHP (foreign name: Php:hypertext Preprocessor, Chinese name: "HypertextPreprocessor") is a commonOpen Sourcescripting language。GrammarAbsorbed theC
The simple factory pattern should be the simplest and most basic pattern in all design patterns, and here is a simple calculator that uses the Factory mode to write a subtraction.1, abstract interface class-dependency reversal principle (both upper
Switch structure can better solve the problem of equivalence judgmentSwitch Select the syntax for the structure:switch (expression) {CASE constant 1:code block 1;BreakCase constant 2:code block 2;Break。。。。。。Defaultcode block N;Break}Explain:1.switch:
-----------android training ,Java training , Java Learning Technology blog, look forward to communicating with you! ------------ There are four syntax constructs in JavaSequential structure: As the name implies, the sentence is executed in order to
Only so called "advanced" usage, because I have not even the most basic use of the switch is not mastered, so, the following is actually the basic use of it!
A switch statement is similar to a series of IF statements that have the same expression.
Program flow control Statements in Java include conditional structure, loop structure, and jump statements4.1-Piece structureThe conditional structure includes the sequential structure and the selection structure. The sequential structure does not
Switch structure in 11.swiftDifference One:Switch condition in OC can only put integersThe switch condition in Swift can put almost any data typeDifference Two:There should be a break in each case in OC, and if there is no break, it will continue
The is only so called "advanced" usage because I have not mastered the most basic usage of the switch, so, the following is actually the basic usage of it! The Switch statement is similar to a series of IF statements that have the same
The last time, "Big talk design mode C + +-Simple factory model" pointed out the shortcomings of the simple factory model, that is, against the development-closure principle, the main reason is because of the use of switch judgment structure, so as
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.