1, Java Language Foundation (circular structure Overview and for statement format and use)
2, Java Language Foundation (loop structure for the practice of the statement to get data)
- A: Case Demo
- Requirements: Please output data in the console 1-10
- Requirements: Please output data in the console 10-1
- B: Precautions
- A: Determines whether a conditional statement is a Boolean type, either simple or complex.
- B: Loop body statement If it is a statement, the curly braces can be omitted, and in the case of multiple statements, the curly braces cannot be omitted. Never omit the suggestion.
- C: Generally speaking: there is no semicolon on the left curly brace, there is no left brace for the semicolon
3, the Java Language Foundation (loop structure for statement practice summation idea)
- A: Case Demo
- Requirements: Finding the sum of data between 1-10
- B: Student Practice
- Requirements: Find the number of even numbers between 1-100 and
- Requirements: Find out between 1-100 odd and
4, Java Language Foundation (looping structure for statement of practice Narcissus)
5. Java Language Foundation (the statistical idea of the practice of loop structure for statement)
- A: Case Demo
- Requirements: Statistics of "narcissus number" total number of
6. The Java Language Foundation (the format and basic use of the loop structure while statement)
7. Java Language Foundation (practice of loop structure while statement)
- A: Summation thought
- B: Statistical Ideas
- Count the number of daffodils.
8, the Java Language Foundation (circular structure do...while statement format and basic use)
9, the Java Language Foundation (circular structure three kinds of circular statement difference)
- A: Case Demo
- The difference between the three circular statements:
- The Do...while loop executes at least one loop body.
- The For,while cycle must first determine whether the condition is true, and then decide whether to execute the Loop body statement.
- B: Case Demo
- The difference between a for loop and a while loop:
- A: If you want to continue using the variable that controls the condition after the loop is over, use the while loop, otherwise use the For loop. I don't know who to use for loop. Because variables disappear early from memory, you can improve the efficiency of memory usage.
10, the Java Language Foundation (circular structure Notice of the death cycle)
- A: Must pay attention to control the condition statement control the problem of the variable, do not lose, otherwise it is easy to die cycle.
- B: Two of the simplest dead loop formats
- while (true) {...}
- for (;;) {...}
11, Java Language Foundation (loop structure loop nesting output 4 rows 5 columns of stars)
A: Case Demo
- B: Conclusion:
- Outer loop control number of rows, inner loop control number of columns
12, Java Language Foundation (loop structure loop nested output positive triangle)
13. Java Language Foundation (loop structure 99 multiplication table)
14. Java Language Foundation (Control jump statement break statement)
15, Java Language Foundation (Control jump statement continue statement)
- A:continue Usage Scenarios
16, the Java Language Foundation (Control jump statement label)
- Label: Mark a loop to control it
- Label composition rule: is actually a valid identifier
17, Java Language Foundation (Control adjustment statement exercise)
18. Java Language Foundation (Control jump statement return statement)
- The role of A:return
- Return
- In fact, its function is not to end the loop, but to end the method.
- B: Case Demo
- What is the difference between return and break and continue?
- Return is the End method
- Break is jumping out of the loop
- Continue is to terminate this cycle and continue the next cycle.
19. Java Language Foundation (method overview and format description)
20. Java language Foundation (method summation case and its invocation)
- A: How to write a method
- 1, explicit return value type
- 2, clear parameter list
- B: Case Demo
- Requirements: two cases of data
- C: Method Invocation Plot
21. Java language Basics (method Considerations)
- A: Method invocation (with a specific return value)
- A: Call alone, generally no meaning, so not recommended.
- B: The output is called, but not good enough. Because we may need to do further work on the results.
- C: Assignment invocation, recommended scenario.
- B: Case Demo
- A: Method does not call do not execute
- B: Methods and methods are lateral relationships, cannot be nested defined
- C: When the method is defined, the arguments are separated by commas
- D: Do not pass the data type at the time of method invocation
- E: If the method has a definite return value, be sure to have return with a value
22. Java Language Basics (practice of methods)
- A: Case Demo
- Requirements: Keyboard input two data, return two number of large values
- B: Case Demo
- Requirements: Keyboard input Two data, compare two number is equal
23. Java Language Foundation (the output star of the method and its invocation)
- A: Case Demo
- Requirements: Based on the number of rows and columns entered by the keyboard, the output star in the console
- B: Method Invocation: (no return value, void)
- called separately
- Output Call (Error)
- Assignment Invocation (Error)
24. Java Language Basics (practice of methods)
- A: Case Demo
- Requirements: Data output According to the keyboard input the corresponding multiplication table
25. Java language Basics (Method overloading overview and basic usage)
- A: Overview of method overloading
- Summation case
- 2 integers
- 3 integers
- 4 integers
B: Method Overloading:
In the same class, the method name is the same, and the parameter list is different. Is independent of the return value type.
The parameter list is different:
- A: Different number of parameters
- B: Different parameter types
- C: The order of the parameters is different (overloaded, but not in development)
26. Java Language Foundation (method overloading exercises compare data for equality)
- A: Case Demo
- Requirement: Compare two data for equality.
- parameter types are two int type, two double type, and are tested in the Main method
Java EE Basics (iv)