BlueJ Basics &
Program Practice

Your first hands-on journey into the world of Java development.

Starting BlueJ

BlueJ Setup: Project & Class

01
Create ProjectProject -> New Project -> Name it 'LearnJava'
02
Create ClassNew Class -> Class Name: 'Lab' (First letter Capital)
03
Open EditorDouble click the 'Lab' class icon
04
Prepare SkeletonReplace the default code with the Main Method skeleton
05
Coding Time 🚀Write your brilliant code inside the main method. Make it alive!
Compile & Run

The Skeleton

The mandatory structure for every program

Lab1.java
java

Auto Align

Use Cmd + Shift + I to fix your indentation instantly.

Entrance

Remember: main method is the "Entrance Doorway" 🚪.

Golden Rules

Beginner's guide to avoid critical pitfalls

Input Method

Always use English mode for symbols like ; ( ) { }

Semicolons

Every statement must end with a semicolon ;

Case Sensitivity

System is NOT same as system. Java is very strict!

Brace Pairing

Every { must have a matching }
The Chinese punctuation is your #1 enemy!

Hello Java!

Self Introduction Mission

Write three statements in your main method:

1
Say 'Hello!'
2
Say 'My name is xxx.'stay on same line
3
Introduce yourselfwith newline

Quote Magic

Mastering Escape Sequences

Objective: Print exactly this text

He said "Java is fun!"

Pro Tip

Compiler hates nested raw quotes.
Use \" to tell it: "This is just text!"

Numeric Lab

Mental Math Challenge

1. 11 / 4

2. 11 % 4

3. 3 / 10

4. 3 % 10

5. 8 + 2 * 3

6. (8+2) * 3

Debug Session

Read the compiler's mind

system vs System

"package system does not exist"

Missing Semicolon

"';' expected"

Unmatched { }

"reached end of file while parsing"

Lab Summary

Congratulations on your first steps!

Programming is a CRAFT. 🛠️

Reading docs 10 times
isn't as good as typing code ONCE.

Final Task

*
***
*****
*******
###

ASCII Christmas Tree

Print a beautiful Christmas tree in the console.