Java basics
Java basics
Objective: Write a simple Java program that prints "Hello, World!" to the screen.
Step-by-Step Instructions:
Run the program. You should see Hello, World! printed to the screen.
Code Example:
Step-by-Step Instructions:
6. Run the program. You should see the values of the variables printed to the screen.
Code Example:
Objective: Learn how to use if-else statements to make decisions in your program.
Step-by-Step Instructions:
6. Run the program. Enter an age when prompted, and the program will tell you if you’re
an adult or a minor.
Code Example:
4. Loops (for loop)
Step-by-Step Instructions:
5. Run the program. You should see the numbers 1, 2, 3, 4, and 5 printed on the screen.
Code Example:
5. Functions (Methods)
Step-by-Step Instructions:
6. Run the program. The program should greet both "Alice" and "Bob".
Code Example: