Before session 2
Program Control Statements. Loops. Methods. Arrays.
Objectives:
When you finish this module, you will
- explain the following terms: program control statements, loops, signature of a method, formal and actual parameters, types of methods, a return statement;
- controls program flow using
if
statements and nestedif
statements; - choose the appropriate repetition control statement for a given task and implement it in a program using
while
,do-while
orfor
(nested) statements; - define simple static methods with formal parameters;
- invoke static methods with actual parameters;
- define methods with a return value;
- use method overloading;
- describe the essence of arrays in programming;
- declare a one- and multidimensional array reference variables and create arrays;
- declare, create, and initialize a one- and multidimensional array using an array initializer;
- access array elements using indexes;
- simplify programming using the for each loops;
- retrieve data from the command line and convert them into an appropriate data type.
Topics
- 2.1 Conditional statements
- 2.2 Loops
- 2.3 Methods. Void method
- 2.6 Arrays
- 2.8 Command-line arguments
- 2.9 Tasks
NB! Watch the video in youtube if you need the subtitles!
Alternative materials
- in English:
- H. Schildt. Java - The Complete Reference: Chapters: 3 (arrays), 5, 7
- A. B. Downey and C. Mayfield. Think Java: How to Think Like a Computer Scientist: Chapter 4, 6, 8
- in Estonian: here
- in Russian:
- Г. Шилдт. Java 8. Полное руководство: Chapters: 3 (arrays), 5, 7
- Videos 8- 10