Services Work Learn About Contact
0/10
Lesson 2 of 10

Variables & Data Types

Java is strongly typed — you must declare the type of every variable. Primitive types include int, double, boolean, and char. Use String for text (it is an object, not a primitive).

JAVA
int age = 25;
double price = 19.99;
boolean isActive = true;
char grade = 'A';
String name = "Ali";

System.out.println(name);
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed Java!

You finished all 10 lessons and quizzes. You now know the basics of Java.