Java
From your first program to OOP and data structures
The core Pro Lab track: variables, conditions, loops, arrays and methods, then classes, inheritance, interfaces and collections — linked directly to quizzes and lab challenges.
- 46 lessons
- 6 chapters
- Arabic & English
Your progress
What's inside
Lessons go from the basics to advanced topics. Read them in order, or jump to what you need.
Chapter 1
Getting Started
- 1Java IntroductionDiscover what Java is, where it is used, and how the same Java program runs on any device thanks to the JVM.
- 2Java Get StartedInstall the JDK, write your first program in Main.java, then compile it with javac and run it with java.
- 3Java SyntaxUnderstand the structure of a Java program line by line: the class, the main method, statements, semicolons and curly braces.
- 4Java OutputPrint text and numbers with println() and print(), and format your output neatly with printf().
- 5Java CommentsUse single-line, multi-line and documentation comments to explain your code and make it easier to read.
Chapter 2
Variables & Data Types
- 6Java VariablesLearn how to create variables to store data, change their values, make constants with final, and name your variables correctly.
- 7Java Data TypesExplore Java's 8 primitive data types, their sizes and ranges, and how reference types like String are different.
- 8Java Type CastingConvert values between primitive types: automatic widening casting, and manual narrowing casting with (type).
- 9Java OperatorsUse arithmetic, assignment, comparison and logical operators, and avoid the classic integer division and % pitfalls.
- 10Java StringsWork with text in Java: length, letter case, indexOf, charAt, substring, concatenation, comparing with equals(), and special characters.
- 11Java MathUse the built-in Math class to find maximum and minimum values, square roots, powers, absolute values, rounding and random numbers.
- 12Java BooleansStore true/false values with boolean, build boolean expressions with comparisons, and combine conditions with &&, || and !.
- 13Java User Input (Scanner)Read text and numbers from the keyboard with the Scanner class, and avoid the classic nextInt() + nextLine() pitfall.
Chapter 3
Control Flow
- 14Java If ... ElseMake decisions in your programs with if, else and else if, logical operators, and the short-hand ternary operator.
- 15Java SwitchChoose one of many code blocks with switch: the classic form with case and break, and the modern arrow form (Java 14+).
- 16Java While LoopRepeat code while a condition is true with the while loop, and run it at least once with do/while.
- 17Java For LoopRepeat code a known number of times with the for loop, nest loops inside each other, and go through arrays with for-each.
- 18Java Break and ContinueStop a loop early with break, skip the current iteration with continue, and exit nested loops with labels.
Chapter 4
Arrays & Methods
- 19Java ArraysStore many values in one variable with arrays: create them, read and change elements, loop through them, and use Arrays.toString() and Arrays.sort().
- 20Java Multi-Dimensional ArraysStore data in rows and columns with two-dimensional arrays, access elements with [row][column], and loop through them with nested loops.
- 21Java MethodsCreate your own methods to organize code into reusable blocks, call them from main, and understand what static and void mean.
- 22Java Method ParametersPass information into methods with parameters, use several parameters, and send results back with return.
- 23Java Method OverloadingDefine several methods with the same name but different parameters, and let Java choose the right one based on the arguments.
- 24Java ScopeUnderstand where a variable can be used: method scope, block scope, loop scope, and why each method has its own variables.
- 25Java RecursionLearn how a method can call itself, why every recursive method needs a base case, and solve sum and factorial problems with recursion.
Chapter 5
Object-Oriented Programming
- 26Java OOPDiscover what Object-Oriented Programming is, why Java is built around it, how classes relate to objects, and the four pillars you will master in this chapter.
- 27Java Classes and ObjectsCreate your first class, build objects from it with the new keyword, work with multiple objects, and organize your code across multiple classes.
- 28Java Class AttributesLearn how to declare class attributes (fields), read and modify them through objects, understand their default values, and protect them with final.
- 29Java Class MethodsDefine methods inside a class, understand the difference between static and instance methods, and call methods on objects to work with their data.
- 30Java ConstructorsUse constructors to initialize objects: the default constructor, constructors with parameters, the this keyword, constructor overloading, and chaining with this(...).
- 31Java ModifiersControl who can access your classes, attributes, and methods with access modifiers, and add special behavior with non-access modifiers such as static, final, and abstract.
- 32Java EncapsulationProtect your data by making attributes private and exposing safe public getters and setters that can validate every change.
- 33Java InheritanceReuse code by letting one class inherit attributes and methods from another with extends, call the parent with super, override methods, and block inheritance with final.
- 34Java PolymorphismSee how one method call can behave in many ways: method overriding, upcasting, dynamic dispatch at runtime, and arrays that hold different subclasses under one supertype.
- 35Java AbstractionHide implementation details and show only what matters, using abstract classes and abstract methods that subclasses must complete.
- 36Java InterfacesDefine contracts with interfaces, implement them with implements, combine multiple interfaces in one class, and add default methods.
- 37Java EnumsRepresent a fixed set of constants with enum, use enums in switch statements, loop over them with values(), and give them attributes of their own.
Chapter 6
Data Structures & Advanced Java
- 38Java ExceptionsHandle runtime errors gracefully with try, catch, and finally, catch several exception types, raise your own errors with throw, and create custom exceptions.
- 39Java Wrapper ClassesUse primitive values as objects with wrapper classes such as Integer and Double, understand autoboxing and unboxing, and convert text to numbers with parse methods.
- 40Java ArrayListStore a flexible number of items with ArrayList: add, access, change, and remove elements, check the size, loop through the list, and sort it.
- 41Java LinkedListLearn how LinkedList differs from ArrayList, when to choose each one, and how to use addFirst(), addLast(), removeFirst(), and related methods.
- 42Java HashMapStore data as key/value pairs with HashMap: add, read, update, and remove entries, check for keys, loop with keySet(), values(), and entrySet(), and count with getOrDefault().
- 43Java HashSetKeep a collection of unique items with HashSet: add, check, and remove elements, and get rid of duplicates in your data in one step.
- 44Java IteratorLoop through any collection with an Iterator using hasNext() and next(), and remove items safely while looping.
- 45Java GenericsWrite flexible, type-safe code with generics: create a generic class like Box<T>, write generic methods, and restrict the allowed types with bounded type parameters.
- 46Java Lambda ExpressionsWrite short, nameless functions with lambda expressions, use them with forEach(), removeIf(), and sort(), and store them in functional interfaces.