SlideShare a Scribd company logo
Java Tutorial
Part 1: Getting Started
with Java Coding
Welcome
to Coding
Writing
and Running
Java Code
 Coding means to give commands to tell the computer what to do
 Sample command:
 A computer program is a sequence of commands (lines of code)
What is Coding?
System.out.println("Hey, I am coding");
System.out.println("First command");
System.out.println("Second command");
System.out.println("Third command");
Repl.it: An Online Coding Environment
Register at:
https://repl.it
Write, compile
and run code in
Java, JS, Python
and others
Repl.it: An Online Coding Environment
 Calculate an expression and print its value:
Commands in Java – Examples
System.out.println(5 + 5);
 Check if certain word contains another word
System.out.println("softuni".contains("uni"));
 Print the numbers from 1 to 100
for (int i = 1; i <= 100; i++)
System.out.println(i);
Coding
Concepts
Programming,
Commands, Code,
Algorithms, IDEs
 Programming means writing computer programs (commands)
 Using certain programming language, such as Java or Python
 Algorithm == a sequence of commands that achieves certain result
 Programming (coding) is performed by programmers (developers)
 Programmers use IDE (like IntelliJ IDEA or Eclipse or REPL.it) to:
 Write the code
 Run and test the code
 Find a fix bugs (debug the code)
Programming and Algorithms
 Sample Java program (sequence of Java commands):
Computer Program – Example
int size = 5;
System.out.println("Size = " + size);
System.out.println("Area = " + size * size);
 Sample complete Java program (class + method + commands):
Complete Computer Program
public class Main {
public static void main(String[] args) {
int size = 5;
System.out.println("Size = " + size);
System.out.println(
"Area = " + size * size);
}
}
 Java program, which converts from USD to EUR (at fixed rate)
Console-Based Java Program – Example
Scanner scanner = new Scanner(System.in);
int dollars = scanner.nextInt();
double euro = dollars * 0.883795087;
System.out.println("Euro: " + euro);
Put this line of code:
import java.util.Scanner;
before the class definition
The Judge System
Sending your Solutions
for Automated Evaluation
Testing the Program in the Judge System
 Test your code online in the SoftUni Judge system:
https://judge.softuni.org/Contests/3250
Java Tutorial: Part 1. Getting Started
 To learn coding, you need to write code!
 Watching videos gives you only knowledge
 Solving the exercises, gives you experience and
practical skills
Learn by Doing
Write and submit the
coding exercises!
 Write a Java program, which:
 Prints "Hello Java" on the console
 Submit your solution in the SoftUni judge:
https://judge.softuni.org/Contests/Practice/Index/3250
Problem: Print "Hello Java"
Solution: Print "Hello Java"
public class Main {
public static void main(String[] args) {
System.out.println("Hello Java");
}
}
Submission in the Judge System
https://judge.softuni.org/Contests/Practice/Index/3250
 Write a Java program, which:
 Calculates the value of 5 * 5
 Prints the result at the console
 Submit your solution in the SoftUni judge:
https://judge.softuni.org/Contests/Practice/Index/3250
Problem: Calculate and Print 5 * 5
Solution: Calculate and Print 5 * 5
public class Main {
public static void main(String[] args) {
System.out.println(5 * 5);
}
}
 Write a program to print your name at the first line and
calculate and print the expression 5 + 3 at the second line
 The expected output from your program might look like this:
 Another example of valid output:
Problem: Name and Expression
Maria
8
Peter
8
 Write a program, which calculates and prints the value of the
following expressions:
 5 + 3 * 2
 4 * (2 + 3)
 (2 + 5) * (8 - 2) / 7
Problem: Calculations
 Write a program, which:
 Prints a square of 7 * 7 stars like this:
Problem: Square of 7 * 7 Stars
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
 First solution:
 Second solution:
Solution: Square of 7 * 7 Stars
System.out.println("* * * * * * *");
System.out.println("* * * * * * *");
System.out.println("* * * * * * *");
System.out.println("* * * * * * *");
System.out.println("* * * * * * *");
System.out.println("* * * * * * *");
System.out.println("* * * * * * *");
for (int i = 0; i < 7; i++)
System.out.println("* * * * * * *");
Problem: EUR to USD Converter
 Write a Java program, which converts from USD to EUR
 Assume the EUR/USD rate is fixed: 1.17 USD for 1 EUR
 Sample input:
 Sample output:
5
USD = 5.85
Solution: EUR to USD Converter
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double eur = scan.nextDouble();
double usd = eur * 1.17;
System.out.println("USD = " + usd);
}
}
Java Tutorial: Part 1. Getting Started
 The only way you can learn coding is by practice
 By writing code, a lot of code, every day
Learn by Doing
Write and submit the coding
exercises to gain experience!
 …
 …
 …
Next Steps
 Join the SoftUni "Learn To Code" Community
 Get Help from the Mentors
 Meet the Other Learners
 Get Free Coding Lessons
https://softuni.org
Ad

More Related Content

What's hot (20)

05. Java Loops Methods and Classes
05. Java Loops Methods and Classes05. Java Loops Methods and Classes
05. Java Loops Methods and Classes
Intro C# Book
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
Sanjeev Tripathi
 
10. Recursion
10. Recursion10. Recursion
10. Recursion
Intro C# Book
 
02. Data Types and variables
02. Data Types and variables02. Data Types and variables
02. Data Types and variables
Intro C# Book
 
05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional Statements
Intro C# Book
 
19. Data Structures and Algorithm Complexity
19. Data Structures and Algorithm Complexity19. Data Structures and Algorithm Complexity
19. Data Structures and Algorithm Complexity
Intro C# Book
 
04. Console Input Output
04. Console Input Output 04. Console Input Output
04. Console Input Output
Intro C# Book
 
Java Programs
Java ProgramsJava Programs
Java Programs
vvpadhu
 
03. Operators Expressions and statements
03. Operators Expressions and statements03. Operators Expressions and statements
03. Operators Expressions and statements
Intro C# Book
 
15. Streams Files and Directories
15. Streams Files and Directories 15. Streams Files and Directories
15. Streams Files and Directories
Intro C# Book
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstraction
Intro C# Book
 
11. Java Objects and classes
11. Java  Objects and classes11. Java  Objects and classes
11. Java Objects and classes
Intro C# Book
 
Java ppt
Java pptJava ppt
Java ppt
Rohan Gajre
 
DSA 103 Object Oriented Programming :: Week 4
DSA 103 Object Oriented Programming :: Week 4DSA 103 Object Oriented Programming :: Week 4
DSA 103 Object Oriented Programming :: Week 4
Ferdin Joe John Joseph PhD
 
Simple Java Programs
Simple Java ProgramsSimple Java Programs
Simple Java Programs
AravindSankaran
 
Reading and writting v2
Reading and writting v2Reading and writting v2
Reading and writting v2
ASU Online
 
20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction
Intro C# Book
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: Methods
Svetlin Nakov
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
Abdul Haseeb
 
05. Java Loops Methods and Classes
05. Java Loops Methods and Classes05. Java Loops Methods and Classes
05. Java Loops Methods and Classes
Intro C# Book
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
Sanjeev Tripathi
 
02. Data Types and variables
02. Data Types and variables02. Data Types and variables
02. Data Types and variables
Intro C# Book
 
05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional Statements
Intro C# Book
 
19. Data Structures and Algorithm Complexity
19. Data Structures and Algorithm Complexity19. Data Structures and Algorithm Complexity
19. Data Structures and Algorithm Complexity
Intro C# Book
 
04. Console Input Output
04. Console Input Output 04. Console Input Output
04. Console Input Output
Intro C# Book
 
Java Programs
Java ProgramsJava Programs
Java Programs
vvpadhu
 
03. Operators Expressions and statements
03. Operators Expressions and statements03. Operators Expressions and statements
03. Operators Expressions and statements
Intro C# Book
 
15. Streams Files and Directories
15. Streams Files and Directories 15. Streams Files and Directories
15. Streams Files and Directories
Intro C# Book
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstraction
Intro C# Book
 
11. Java Objects and classes
11. Java  Objects and classes11. Java  Objects and classes
11. Java Objects and classes
Intro C# Book
 
Reading and writting v2
Reading and writting v2Reading and writting v2
Reading and writting v2
ASU Online
 
20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction
Intro C# Book
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: Methods
Svetlin Nakov
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
Abdul Haseeb
 

Similar to Java Tutorial: Part 1. Getting Started (20)

Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdf
mayorothenguyenhob69
 
05A_Java_in yemen adenProgramming_IT.pptx
05A_Java_in yemen adenProgramming_IT.pptx05A_Java_in yemen adenProgramming_IT.pptx
05A_Java_in yemen adenProgramming_IT.pptx
akrmalslami88
 
All Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docxAll Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docx
adhitya5119
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diploma
mustkeem khan
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdf
Sathwika7
 
00_Introduction to Java.ppt
00_Introduction to Java.ppt00_Introduction to Java.ppt
00_Introduction to Java.ppt
HongAnhNguyn285885
 
Java Primitive Type from Long Nguyen's lecture
Java Primitive Type from Long Nguyen's lectureJava Primitive Type from Long Nguyen's lecture
Java Primitive Type from Long Nguyen's lecture
ssusere8fc511
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
Zeeshan MIrza
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
AbhishekSingh757567
 
djkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjj
djkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjjdjkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjj
djkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjj
AbhishekSingh757567
 
Java Notes
Java Notes Java Notes
Java Notes
Sreedhar Chowdam
 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPREC
Sreedhar Chowdam
 
01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one
ssuser656672
 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4
sotlsoc
 
ma project
ma projectma project
ma project
Aisu
 
07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt
Ajenkris Kungkung
 
ch01-basic-java-programs.ppt
ch01-basic-java-programs.pptch01-basic-java-programs.ppt
ch01-basic-java-programs.ppt
Mahyuddin8
 
JAVA Programming notes.ppt
JAVA Programming notes.pptJAVA Programming notes.ppt
JAVA Programming notes.ppt
AravindSiva19
 
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdfJava Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdf
Aditya Kumar
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdf
mayorothenguyenhob69
 
05A_Java_in yemen adenProgramming_IT.pptx
05A_Java_in yemen adenProgramming_IT.pptx05A_Java_in yemen adenProgramming_IT.pptx
05A_Java_in yemen adenProgramming_IT.pptx
akrmalslami88
 
All Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docxAll Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docx
adhitya5119
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diploma
mustkeem khan
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdf
Sathwika7
 
Java Primitive Type from Long Nguyen's lecture
Java Primitive Type from Long Nguyen's lectureJava Primitive Type from Long Nguyen's lecture
Java Primitive Type from Long Nguyen's lecture
ssusere8fc511
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
Zeeshan MIrza
 
djkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjj
djkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjjdjkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjj
djkkfhulkgyftfdtrdrsdsjjjjjjjjjjjjjjjjjjj
AbhishekSingh757567
 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPREC
Sreedhar Chowdam
 
01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one01-ch01-1-println.ppt java introduction one
01-ch01-1-println.ppt java introduction one
ssuser656672
 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4
sotlsoc
 
ma project
ma projectma project
ma project
Aisu
 
ch01-basic-java-programs.ppt
ch01-basic-java-programs.pptch01-basic-java-programs.ppt
ch01-basic-java-programs.ppt
Mahyuddin8
 
JAVA Programming notes.ppt
JAVA Programming notes.pptJAVA Programming notes.ppt
JAVA Programming notes.ppt
AravindSiva19
 
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdfJava Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdf
Aditya Kumar
 
Ad

More from Svetlin Nakov (20)

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

Recently uploaded (20)

Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 

Java Tutorial: Part 1. Getting Started

  • 1. Java Tutorial Part 1: Getting Started with Java Coding
  • 3.  Coding means to give commands to tell the computer what to do  Sample command:  A computer program is a sequence of commands (lines of code) What is Coding? System.out.println("Hey, I am coding"); System.out.println("First command"); System.out.println("Second command"); System.out.println("Third command");
  • 4. Repl.it: An Online Coding Environment Register at: https://repl.it Write, compile and run code in Java, JS, Python and others
  • 5. Repl.it: An Online Coding Environment
  • 6.  Calculate an expression and print its value: Commands in Java – Examples System.out.println(5 + 5);  Check if certain word contains another word System.out.println("softuni".contains("uni"));  Print the numbers from 1 to 100 for (int i = 1; i <= 100; i++) System.out.println(i);
  • 8.  Programming means writing computer programs (commands)  Using certain programming language, such as Java or Python  Algorithm == a sequence of commands that achieves certain result  Programming (coding) is performed by programmers (developers)  Programmers use IDE (like IntelliJ IDEA or Eclipse or REPL.it) to:  Write the code  Run and test the code  Find a fix bugs (debug the code) Programming and Algorithms
  • 9.  Sample Java program (sequence of Java commands): Computer Program – Example int size = 5; System.out.println("Size = " + size); System.out.println("Area = " + size * size);
  • 10.  Sample complete Java program (class + method + commands): Complete Computer Program public class Main { public static void main(String[] args) { int size = 5; System.out.println("Size = " + size); System.out.println( "Area = " + size * size); } }
  • 11.  Java program, which converts from USD to EUR (at fixed rate) Console-Based Java Program – Example Scanner scanner = new Scanner(System.in); int dollars = scanner.nextInt(); double euro = dollars * 0.883795087; System.out.println("Euro: " + euro); Put this line of code: import java.util.Scanner; before the class definition
  • 12. The Judge System Sending your Solutions for Automated Evaluation
  • 13. Testing the Program in the Judge System  Test your code online in the SoftUni Judge system: https://judge.softuni.org/Contests/3250
  • 15.  To learn coding, you need to write code!  Watching videos gives you only knowledge  Solving the exercises, gives you experience and practical skills Learn by Doing Write and submit the coding exercises!
  • 16.  Write a Java program, which:  Prints "Hello Java" on the console  Submit your solution in the SoftUni judge: https://judge.softuni.org/Contests/Practice/Index/3250 Problem: Print "Hello Java"
  • 17. Solution: Print "Hello Java" public class Main { public static void main(String[] args) { System.out.println("Hello Java"); } }
  • 18. Submission in the Judge System https://judge.softuni.org/Contests/Practice/Index/3250
  • 19.  Write a Java program, which:  Calculates the value of 5 * 5  Prints the result at the console  Submit your solution in the SoftUni judge: https://judge.softuni.org/Contests/Practice/Index/3250 Problem: Calculate and Print 5 * 5
  • 20. Solution: Calculate and Print 5 * 5 public class Main { public static void main(String[] args) { System.out.println(5 * 5); } }
  • 21.  Write a program to print your name at the first line and calculate and print the expression 5 + 3 at the second line  The expected output from your program might look like this:  Another example of valid output: Problem: Name and Expression Maria 8 Peter 8
  • 22.  Write a program, which calculates and prints the value of the following expressions:  5 + 3 * 2  4 * (2 + 3)  (2 + 5) * (8 - 2) / 7 Problem: Calculations
  • 23.  Write a program, which:  Prints a square of 7 * 7 stars like this: Problem: Square of 7 * 7 Stars * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  • 24.  First solution:  Second solution: Solution: Square of 7 * 7 Stars System.out.println("* * * * * * *"); System.out.println("* * * * * * *"); System.out.println("* * * * * * *"); System.out.println("* * * * * * *"); System.out.println("* * * * * * *"); System.out.println("* * * * * * *"); System.out.println("* * * * * * *"); for (int i = 0; i < 7; i++) System.out.println("* * * * * * *");
  • 25. Problem: EUR to USD Converter  Write a Java program, which converts from USD to EUR  Assume the EUR/USD rate is fixed: 1.17 USD for 1 EUR  Sample input:  Sample output: 5 USD = 5.85
  • 26. Solution: EUR to USD Converter import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double eur = scan.nextDouble(); double usd = eur * 1.17; System.out.println("USD = " + usd); } }
  • 28.  The only way you can learn coding is by practice  By writing code, a lot of code, every day Learn by Doing Write and submit the coding exercises to gain experience!
  • 29.  …  …  … Next Steps  Join the SoftUni "Learn To Code" Community  Get Help from the Mentors  Meet the Other Learners  Get Free Coding Lessons https://softuni.org

Editor's Notes

  • #2: Hello, I am Svetlin Nakov from SoftUni. I am an experienced software engineer and tech trainer and I love to teach beginners how to code. During the last 15 years I've helped more than one hundred thousand young people to begin coding, learn software development and start a job in the IT industry. Just Google my name and you will find more about what I do as a technical trainer. Today I am excited to start teaching programming and software technologies on a global scale for my growing "learn to code" community. Welcome to my free code lessons. The code lessons are not just video tutorials. They combine videos with practical exercises, where you write code after each lesson, and you learn by doing, by writing code, fixing bugs and learning from your mistakes. Why do you need to practice? Because coding is a skill. It cannot be learned by watching videos. That's why after each code lesson I will give you a set of practical coding exercises. I will introduce you to the automated evaluation system (the SoftUni judge), where you send your code, and the system tells you if it's correct or not. And it's free, so everyone can use it to check their skills. Today I will start with a simple tutorial for Java programming for absolute beginners. This will be the first lesson, but it is just a start. In the next few weeks, I will publish a series of Java lessons, which follow logically one after another, so if you want to learn Java coding, just follow the lessons in the correct order. In this lesson, I will explain what coding is, what are commands and what is their syntax in Java. I will show you how to write simple Java commands and Java programs. Together we will solve a few coding exercises to practice our new skills. We shall use a free online code editor called repl.it, so you need nothing more than your laptop. I recommend to use a laptop instead of a tablet or smartphone, because it works better. Finally, I will show you how to use the SoftUni Judge, our automated code evaluation system and how to submit your code for automated grading. OK, let's start. Let's begin learning Java. It's easy. Just follow my instructions.
  • #3: Welcome to coding! In this section I will explain what coding is and how to write simple commands in Java. Together, we'll write and execute a few small Java programs. We shall use the online code editor repl.it, so you will need nothing more than your laptop.
  • #8: In the next section I am going to explain you some basic programming concepts, such as coding, code commands, programming, computer programs, algorithms, programmers, software developers, and development environments (IDEs). I will demonstrate an example of a complete Java program, which holds a class definition, a method definition and a few commands inside.
  • #13: Now I want to show you the SoftUni judge system. SoftUni Judge is an automated system for code evaluation. Just send your code solution for 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!
  • #15: Now, it's your turn to write code. Please, don't skip the exercises! The only way you can learn to code is by coding. Follow the exercises, which I have prepared for you in this lesson, write the code, submit it in the judge system, and you will get the practical skills from this lesson, not just the theory. Find the exercise descriptions and the link to judge at softuni.org. Are you ready to practice? I will show you how.
  • #30: Remember that the most important activity in learning how to code is "coding"! Maybe, I repeated myself several times, but it is tremendously important to do and submit your exercises and to practice what you have learned today, to develop it as a skill.
  • #32: Thank you for joining this free code lesson. I hope you have found that writing Java code is not scary and you can try it yourself. Now it's your turn. Now it's time to start coding, because to gain skills, you should practice! Solve and submit the practical exercises from the lesson. It is really, really important! Join the SoftUni global learn-to-code community at softuni.org. Register at the SoftUni Web site to get access to the exercises, the automated judge system to check your code and to our community resources. Meet your mentors and other learners. Talk to them and get help. And this is free! Yes, you can learn for free: you can access our existing and new upcoming code lessons and coding videos and tutorials for free. Just subscribe and you will get an email for each code lesson when it is published. You can get free help for any coding problem you have. Our mentors and instructors in the SoftUni community will answer any question you ask in our discussion board. Just join and ask. And this is also free. Talk to other learners like you. Share resources, ask questions, get involved, learn in a group. Learning works better when you have people together with you. Finally, subscribe to my YouTube channel to watch more videos like this and to get notifications for my new code lessons. Goodbye. See you in my next video lesson.