SlideShare a Scribd company logo
Java Foundations
Objects
and Classes
Your Course
Instructors
Svetlin Nakov
George Georgiev
The Judge System
Sending your Solutions
for Automated Evaluation
Testing Your Code in the Judge System
 Test your code online in the SoftUni Judge system:
https://judge.softuni.org/Contests/3294
Objects and Classes
Using Objects and Classes
Defining Simple Classes
Table of Contents
1. Objects: Set of Data Fields
2. Classes: Define the Object Structure
3. Built-in Classes
4. Defining Simple Classes
 Fields
 Constructors
 Methods
class
DateTime
Day: int
Month: int
Year: int
AddDays(…)
Subtract(…)
object
peterBirthday
Day = 27
Month = 11
Year = 1996
Objects and Classes
Objects
 An object holds a set of named values
 E.g. birthday object holds day, month and year
 Creating a birthday object:
9
Birthday
day = 27
month = 11
year = 1996
LocalDate birthday =
LocalDate.of(2018, 5, 5);
System.out.println(birthday);
Create a new object of
type LocalDate
Object
fields
Object
name
Classes
 In programming classes provide the structure for objects
 Act as a blueprint for objects of the same type
 Classes define:
 Fields (private variables), e.g. day, month, year
 Getters/Setters, e.g. getDay, setMonth, getYear
 Actions (behavior), e.g. plusDays(count),
subtract(date)
 Typically a class has multiple instances (objects)
 Sample class: LocalDate
 Sample objects: birthdayPeter, birthdayMaria
10
Objects - Instances of Classes
 Creating the object of a defined class is
called instantiation
 The instance is the object itself, which is
created runtime
 All instances have common behaviour
11
LocalDate date1 = LocalDate.of(2018, 5, 5);
LocalDate date2 = LocalDate.of(2016, 3, 5);
LocalDate date3 = LocalDate.of(2013, 3, 2);
Classes vs. Objects
 Classes provide structure for
creating objects
 An object is a single
instance of a class
12
class
LocalDate
day: int
month: int
year: int
plusDays(…)
minusDays(…)
Class actions
(methods)
Class name
Class fields
object
birthdayPeter
day = 27
month = 11
year = 1996
Object
name
Object
data
Using the Built-In API Classes
Math, Random, BigInteger ...
 Java provides ready-to-use classes:
 Organized inside Packages like:
java.util.Scanner, java.utils.List, etc.
 Using static class members:
 Using non-static Java classes:
Built-In API Classes in Java
14
LocalDateTime today = LocalDateTime.now();
double cosine = Math.cos(Math.PI);
Random rnd = new Random();
int randomNumber = rnd.nextInt(99);
 You are given a list of words
 Randomize their order and print each word on a separate line
Problem: Randomize Words
15
Note: the output is a sample.
It should always be different!
a b
b
a
PHP Java C#
Java
PHP
C#
Solution: Randomize Words
16
Scanner sc = new Scanner(System.in);
String[] words = sc.nextLine().split(" ");
Random rnd = new Random();
for (int pos1 = 0; pos1 < words.length; pos1++) {
int pos2 = rnd.nextInt(words.length);
// TODO: Swap words[pos1] with words[pos2]
}
System.out.println(String.join(
System.lineSeparator(), words));
 Calculate n! (n factorial) for very big n (e. g. 1000)
Problem: Big Factorial
17
50
3041409320171337804361260816606476884437764156
8960512000000000000
5 120 10 3628800 12 479001600
88
1854826422573984391147968456455462843802209689
4939934668442158098688956218402819931910014124
4804501828416633516851200000000000000000000
Solution: Big Factorial
18
import java.math.BigInteger;
...
int n = Integer.parseInt(sc.nextLine());
BigInteger f = new BigInteger(String.valueOf(1));
for (int i = 1; i <= n; i++) {
f = f.multiply(BigInteger.valueOf(
Integer.parseInt(String.valueOf(i))));
}
System.out.println(f);
Use the
java.math.BigInteger
N!
Defining Classes
Creating Custom Classes
 Specification of a given type of objects
from the real-world
 Classes provide structure for describing
and creating objects
Defining Simple Classes
20
class Dice {
…
}
Class name
Class body
Keyword
Naming Classes
 Use PascalCase naming
 Use descriptive nouns
 Avoid abbreviations (except widely known, e.g. URL,
HTTP, etc.)
21
class Dice { … }
class BankAccount { … }
class IntegerCalculator { … }
class TPMF { … }
class bankaccount { … }
class intcalc { … }
 Class is made up of state and behavior
 Fields store values
 Methods describe behaviour
Class Members
22
class Dice {
private int sides;
public void roll() { … }
}
Field
Method
 Store executable code (algorithm)
Methods
23
class Dice {
public int sides;
public int roll() {
Random rnd = new Random();
int sides = rnd.nextInt(this.sides + 1);
return sides;
}
}
Getters and Setters
24
class Dice {
…
public int getSides() { return this.sides; }
public void setSides(int sides) {
this.sides = sides;
}
public String getType() { return this.type; }
public void setType(String type) {
this.type = type;
}
}
Getters & setters
 A class can have many instances (objects)
Creating an Object
25
class Program {
public static void main(String[] args) {
Dice diceD6 = new Dice();
Dice diceD8 = new Dice();
}
}
Use the new
keyword
Variable stores
a reference
 Special methods, executed during object creation
Constructors
26
class Dice {
public int sides;
public Dice() {
this.sides = 6;
}
} Overloading
default
constructor
Constructor name
is the same as the
name of the class
 You can have multiple constructors in the same class
Constructors (2)
27
class Dice {
public int sides;
public Dice() { }
public Dice(int sides) {
this.sides = sides;
}
}
class StartUp {
public static void main(String[] args) {
Dice dice1 = new Dice();
Dice dice2 = new Dice(7);
}
}
 Read students until you receive "end" in the following format:
 "{firstName} {lastName} {age} {hometown}"
 Define a class Student, which holds the needed information
 If you receive a student which already exists (matching
firstName and lastName), overwrite the information
 After the end command, you will receive a city name
 Print students which are from the given city in the format:
"{firstName} {lastName} is {age} years old."
Problem: Students
28
Solution: Students (1)
29
public Student(String firstName, String lastName,
int age, String city) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.city = city;
// TODO: Implement Getters and Setters
}
Solution: Students (2)
30
List<Student> students = new ArrayList<>();
String line;
while (!line.equals("end")) {
// TODO: Extract firstName, lastName, age, city from the input
Student existingStudent = getStudent(students, firstName, lastName);
if (existingStudent != null) {
existingStudent.setAge(age);
existingStudent.setCity(city);
} else {
Student student = new Student(firstName, lastName, age, city);
students.add(student);
}
line = sc.nextLine();
}
Solution: Students (3)
31
static Student getStudent(List<Student> students,
String firstName, String lastName) {
for (Student student : students) {
if (student.getFirstName().equals(firstName)
&& student.getLastName().equals(lastName))
return student;
}
return null;
}
 …
 …
 …
Summary
 Classes define templates for objects
 Fields
 Constructors
 Methods
 Objects
 Hold a set of named values
 Instances of a classes
 …
 …
 …
Next Steps
 Join the SoftUni "Learn To Code" Community
 Access the Free Coding Lessons
 Get Help from the Mentors
 Meet the Other Learners
https://softuni.org

More Related Content

PPTX
Java Methods
PDF
Spring Boot
PDF
Methods in Java
PDF
PPT
C# Exceptions Handling
PPT
Basic of Multithreading in JAva
PPS
Jdbc architecture and driver types ppt
PPTX
Optional in Java 8
Java Methods
Spring Boot
Methods in Java
C# Exceptions Handling
Basic of Multithreading in JAva
Jdbc architecture and driver types ppt
Optional in Java 8

What's hot (20)

PPT
JAVA OOP
PPTX
Java Method, Static Block
PDF
Basic Java Programming
PDF
07 java collection
PPTX
Core Java Tutorials by Mahika Tutorials
PDF
Java exception handling ppt
PDF
Java Generics - by Example
ODP
Introduction To Java.
PPT
JDBC – Java Database Connectivity
PDF
Exception handling
PDF
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
PPTX
Introduction to JAVA
PPTX
Concurrency in Java
PDF
Class and Objects in Java
PPTX
Hibernate ppt
PDF
Spring Framework - AOP
ODP
Multithreading In Java
PPTX
File handling
PPT
Java Collections Framework
PPSX
Collections - Lists, Sets
JAVA OOP
Java Method, Static Block
Basic Java Programming
07 java collection
Core Java Tutorials by Mahika Tutorials
Java exception handling ppt
Java Generics - by Example
Introduction To Java.
JDBC – Java Database Connectivity
Exception handling
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Introduction to JAVA
Concurrency in Java
Class and Objects in Java
Hibernate ppt
Spring Framework - AOP
Multithreading In Java
File handling
Java Collections Framework
Collections - Lists, Sets
Ad

Similar to Java Foundations: Objects and Classes (20)

PPTX
11. Java Objects and classes
PPTX
11. Objects and Classes
PPT
Defining classes-and-objects-1.0
PPTX
Session 08 - OOP with Java - continued
PPTX
constructors.pptx
PDF
Lecture3.pdf
PPTX
14 Defining Classes
PPTX
OOP with Java - continued
PPTX
14. Java defining classes
PPSX
OOP with Java - Continued
PPTX
Static keyword ppt
PPT
Classes1
PPTX
03 object-classes-pbl-4-slots
PPTX
03 object-classes-pbl-4-slots
PPTX
Lecture_4_Static_variables_and_Methods.pptx
PPT
Chap08
PDF
Lecture 5
PPTX
c#(loops,arrays)
PPTX
5. c sharp language overview part ii
PPTX
classes object fgfhdfgfdgfgfgfgfdoop.pptx
11. Java Objects and classes
11. Objects and Classes
Defining classes-and-objects-1.0
Session 08 - OOP with Java - continued
constructors.pptx
Lecture3.pdf
14 Defining Classes
OOP with Java - continued
14. Java defining classes
OOP with Java - Continued
Static keyword ppt
Classes1
03 object-classes-pbl-4-slots
03 object-classes-pbl-4-slots
Lecture_4_Static_variables_and_Methods.pptx
Chap08
Lecture 5
c#(loops,arrays)
5. c sharp language overview part ii
classes object fgfhdfgfdgfgfgfgfdoop.pptx
Ad

More from Svetlin Nakov (20)

PPTX
AI and the Future of Devs: Nakov @ Techniverse (Nov 2024)
PPTX
AI за ежедневието - Наков @ Techniverse (Nov 2024)
PPTX
AI инструменти за бизнеса - Наков - Nov 2024
PPTX
AI Adoption in Business - Nakov at Forbes HR Forum - Sept 2024
PPTX
Software Engineers in the AI Era - Sept 2024
PPTX
Най-търсените направления в ИТ сферата за 2024
PPTX
BG-IT-Edu: отворено учебно съдържание за ИТ учители
PPTX
Programming World in 2024
PDF
AI Tools for Business and Startups
PPTX
AI Tools for Scientists - Nakov (Oct 2023)
PPTX
AI Tools for Entrepreneurs
PPTX
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
PPTX
AI Tools for Business and Personal Life
PDF
Дипломна работа: учебно съдържание по ООП - Светлин Наков
PPTX
Дипломна работа: учебно съдържание по ООП
PPTX
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
PPTX
AI and the Professions of the Future
PPTX
Programming Languages Trends for 2023
PPTX
IT Professions and How to Become a Developer
PPTX
GitHub Actions (Nakov at RuseConf, Sept 2022)
AI and the Future of Devs: Nakov @ Techniverse (Nov 2024)
AI за ежедневието - Наков @ Techniverse (Nov 2024)
AI инструменти за бизнеса - Наков - Nov 2024
AI Adoption in Business - Nakov at Forbes HR Forum - Sept 2024
Software Engineers in the AI Era - Sept 2024
Най-търсените направления в ИТ сферата за 2024
BG-IT-Edu: отворено учебно съдържание за ИТ учители
Programming World in 2024
AI Tools for Business and Startups
AI Tools for Scientists - Nakov (Oct 2023)
AI Tools for Entrepreneurs
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
AI Tools for Business and Personal Life
Дипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
AI and the Professions of the Future
Programming Languages Trends for 2023
IT Professions and How to Become a Developer
GitHub Actions (Nakov at RuseConf, Sept 2022)

Recently uploaded (20)

PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPT
Introduction Database Management System for Course Database
PDF
System and Network Administration Chapter 2
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
System and Network Administraation Chapter 3
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
ai tools demonstartion for schools and inter college
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
PDF
How to Confidently Manage Project Budgets
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Build Multi-agent using Agent Development Kit
PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PTS Company Brochure 2025 (1).pdf.......
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
2025 Textile ERP Trends: SAP, Odoo & Oracle
How to Choose the Right IT Partner for Your Business in Malaysia
Introduction Database Management System for Course Database
System and Network Administration Chapter 2
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
System and Network Administraation Chapter 3
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
ai tools demonstartion for schools and inter college
The Role of Automation and AI in EHS Management for Data Centers.pdf
How to Confidently Manage Project Budgets
ISO 45001 Occupational Health and Safety Management System
Materi-Enum-and-Record-Data-Type (1).pptx
Understanding Forklifts - TECH EHS Solution
Build Multi-agent using Agent Development Kit
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes

Java Foundations: Objects and Classes

  • 3. The Judge System Sending your Solutions for Automated Evaluation
  • 4. Testing Your Code in the Judge System  Test your code online in the SoftUni Judge system: https://judge.softuni.org/Contests/3294
  • 5. Objects and Classes Using Objects and Classes Defining Simple Classes
  • 6. Table of Contents 1. Objects: Set of Data Fields 2. Classes: Define the Object Structure 3. Built-in Classes 4. Defining Simple Classes  Fields  Constructors  Methods class DateTime Day: int Month: int Year: int AddDays(…) Subtract(…) object peterBirthday Day = 27 Month = 11 Year = 1996
  • 8. Objects  An object holds a set of named values  E.g. birthday object holds day, month and year  Creating a birthday object: 9 Birthday day = 27 month = 11 year = 1996 LocalDate birthday = LocalDate.of(2018, 5, 5); System.out.println(birthday); Create a new object of type LocalDate Object fields Object name
  • 9. Classes  In programming classes provide the structure for objects  Act as a blueprint for objects of the same type  Classes define:  Fields (private variables), e.g. day, month, year  Getters/Setters, e.g. getDay, setMonth, getYear  Actions (behavior), e.g. plusDays(count), subtract(date)  Typically a class has multiple instances (objects)  Sample class: LocalDate  Sample objects: birthdayPeter, birthdayMaria 10
  • 10. Objects - Instances of Classes  Creating the object of a defined class is called instantiation  The instance is the object itself, which is created runtime  All instances have common behaviour 11 LocalDate date1 = LocalDate.of(2018, 5, 5); LocalDate date2 = LocalDate.of(2016, 3, 5); LocalDate date3 = LocalDate.of(2013, 3, 2);
  • 11. Classes vs. Objects  Classes provide structure for creating objects  An object is a single instance of a class 12 class LocalDate day: int month: int year: int plusDays(…) minusDays(…) Class actions (methods) Class name Class fields object birthdayPeter day = 27 month = 11 year = 1996 Object name Object data
  • 12. Using the Built-In API Classes Math, Random, BigInteger ...
  • 13.  Java provides ready-to-use classes:  Organized inside Packages like: java.util.Scanner, java.utils.List, etc.  Using static class members:  Using non-static Java classes: Built-In API Classes in Java 14 LocalDateTime today = LocalDateTime.now(); double cosine = Math.cos(Math.PI); Random rnd = new Random(); int randomNumber = rnd.nextInt(99);
  • 14.  You are given a list of words  Randomize their order and print each word on a separate line Problem: Randomize Words 15 Note: the output is a sample. It should always be different! a b b a PHP Java C# Java PHP C#
  • 15. Solution: Randomize Words 16 Scanner sc = new Scanner(System.in); String[] words = sc.nextLine().split(" "); Random rnd = new Random(); for (int pos1 = 0; pos1 < words.length; pos1++) { int pos2 = rnd.nextInt(words.length); // TODO: Swap words[pos1] with words[pos2] } System.out.println(String.join( System.lineSeparator(), words));
  • 16.  Calculate n! (n factorial) for very big n (e. g. 1000) Problem: Big Factorial 17 50 3041409320171337804361260816606476884437764156 8960512000000000000 5 120 10 3628800 12 479001600 88 1854826422573984391147968456455462843802209689 4939934668442158098688956218402819931910014124 4804501828416633516851200000000000000000000
  • 17. Solution: Big Factorial 18 import java.math.BigInteger; ... int n = Integer.parseInt(sc.nextLine()); BigInteger f = new BigInteger(String.valueOf(1)); for (int i = 1; i <= n; i++) { f = f.multiply(BigInteger.valueOf( Integer.parseInt(String.valueOf(i)))); } System.out.println(f); Use the java.math.BigInteger N!
  • 19.  Specification of a given type of objects from the real-world  Classes provide structure for describing and creating objects Defining Simple Classes 20 class Dice { … } Class name Class body Keyword
  • 20. Naming Classes  Use PascalCase naming  Use descriptive nouns  Avoid abbreviations (except widely known, e.g. URL, HTTP, etc.) 21 class Dice { … } class BankAccount { … } class IntegerCalculator { … } class TPMF { … } class bankaccount { … } class intcalc { … }
  • 21.  Class is made up of state and behavior  Fields store values  Methods describe behaviour Class Members 22 class Dice { private int sides; public void roll() { … } } Field Method
  • 22.  Store executable code (algorithm) Methods 23 class Dice { public int sides; public int roll() { Random rnd = new Random(); int sides = rnd.nextInt(this.sides + 1); return sides; } }
  • 23. Getters and Setters 24 class Dice { … public int getSides() { return this.sides; } public void setSides(int sides) { this.sides = sides; } public String getType() { return this.type; } public void setType(String type) { this.type = type; } } Getters & setters
  • 24.  A class can have many instances (objects) Creating an Object 25 class Program { public static void main(String[] args) { Dice diceD6 = new Dice(); Dice diceD8 = new Dice(); } } Use the new keyword Variable stores a reference
  • 25.  Special methods, executed during object creation Constructors 26 class Dice { public int sides; public Dice() { this.sides = 6; } } Overloading default constructor Constructor name is the same as the name of the class
  • 26.  You can have multiple constructors in the same class Constructors (2) 27 class Dice { public int sides; public Dice() { } public Dice(int sides) { this.sides = sides; } } class StartUp { public static void main(String[] args) { Dice dice1 = new Dice(); Dice dice2 = new Dice(7); } }
  • 27.  Read students until you receive "end" in the following format:  "{firstName} {lastName} {age} {hometown}"  Define a class Student, which holds the needed information  If you receive a student which already exists (matching firstName and lastName), overwrite the information  After the end command, you will receive a city name  Print students which are from the given city in the format: "{firstName} {lastName} is {age} years old." Problem: Students 28
  • 28. Solution: Students (1) 29 public Student(String firstName, String lastName, int age, String city) { this.firstName = firstName; this.lastName = lastName; this.age = age; this.city = city; // TODO: Implement Getters and Setters }
  • 29. Solution: Students (2) 30 List<Student> students = new ArrayList<>(); String line; while (!line.equals("end")) { // TODO: Extract firstName, lastName, age, city from the input Student existingStudent = getStudent(students, firstName, lastName); if (existingStudent != null) { existingStudent.setAge(age); existingStudent.setCity(city); } else { Student student = new Student(firstName, lastName, age, city); students.add(student); } line = sc.nextLine(); }
  • 30. Solution: Students (3) 31 static Student getStudent(List<Student> students, String firstName, String lastName) { for (Student student : students) { if (student.getFirstName().equals(firstName) && student.getLastName().equals(lastName)) return student; } return null; }
  • 31.  …  …  … Summary  Classes define templates for objects  Fields  Constructors  Methods  Objects  Hold a set of named values  Instances of a classes
  • 32.  …  …  … Next Steps  Join the SoftUni "Learn To Code" Community  Access the Free Coding Lessons  Get Help from the Mentors  Meet the Other Learners https://softuni.org

Editor's Notes

  • #2: Hello, I am Svetlin Nakov from SoftUni (the Software University). We are here again with my colleague George Georgiev, to continue teaching this free Java Foundations course, which (as you already know) covers important concepts from Java programming, such as arrays, lists, maps, methods, strings, classes, objects and exceptions, and prepares you for the "Java Foundations" official exam from Oracle. In this lesson your instructor George will explain the concept of objects and classes and will give you real world examples with live Java coding. In programming objects hold a set of data fields. For example, the “Peter’s birthday” object could hold a day (27), plus a month (11, which is November), plus a year (1996). In Java, developers can define classes to describe a particular structure of an object. For example, a DateTime class could contain a day, plus a month, plus a year, all of which are integers. Classes in Java typically hold fields (to keep object’s data) + constructors (to create and initialize objects) + methods (to implement functionality, related to object’s data). Let's learn how to use objects and simple classes in Java through live coding examples, and later solve some hands-on exercises to gain practical experience. Let's start!
  • #3: Before the start, I would like to introduce your course instructors: Svetlin Nakov and George Georgiev, who are experienced Java developers, senior software engineers and inspirational tech trainers. They have spent thousands of hours teaching programming and software technologies and are top trainers from SoftUni. I am sure you will like how they teach programming.
  • #4: Most of this course will be taught by George Georgiev, who is a senior software engineer with many years of experience with Java, JavaScript and C++. George enjoys teaching programming very much and is one of the top trainers at the Software University, having delivered over 300 technical training sessions on the topics of data structures and algorithms, Java essentials, Java fundamentals, C++ programming, C# development and many others. I have no doubt you will benefit greatly from his lessons, as he always does his best to explain the most challenging concepts in a simple and fun way.
  • #5: Before we dive into the course, I want to show you the SoftUni judge system, where you can get instant feedback for your exercise solutions. SoftUni Judge is an automated system for code evaluation. You just send your code for a certain coding problem and the system will tell you whether your solution is correct or not and what exactly is missing or wrong. I am sure you will love the judge system, once you start using it!
  • #6: // Solution to problem "01. Student Information". import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String name = sc.nextLine(); int age = Integer.parseInt(sc.nextLine()); double grade = Double.parseDouble(sc.nextLine()); System.out.printf("Name: %s, Age: %d, Grade: %.2f", name, age, grade); } }
  • #34: Did you like this lesson? Do you want more? Join the learners' community at softuni.org. Subscribe to my YouTube channel to get more free video tutorials on coding and software development. Get free access to the practical exercises and the automated judge system for this coding lesson. Get free help from mentors and meet other learners. Join now! It's free. SOFTUNI.ORG