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
 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);
}
}
 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

More Related Content

What's hot

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 indiaSanjeev 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
 
Reading and writting v2
Reading and writting v2Reading and writting v2
Reading and writting v2ASU 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
 

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
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
 
10. Recursion
10. Recursion10. Recursion
10. Recursion
 
02. Data Types and variables
02. Data Types and variables02. Data Types and variables
02. Data Types and variables
 
05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional Statements
 
19. Data Structures and Algorithm Complexity
19. Data Structures and Algorithm Complexity19. Data Structures and Algorithm Complexity
19. Data Structures and Algorithm Complexity
 
04. Console Input Output
04. Console Input Output 04. Console Input Output
04. Console Input Output
 
Java Programs
Java ProgramsJava Programs
Java Programs
 
03. Operators Expressions and statements
03. Operators Expressions and statements03. Operators Expressions and statements
03. Operators Expressions and statements
 
15. Streams Files and Directories
15. Streams Files and Directories 15. Streams Files and Directories
15. Streams Files and Directories
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstraction
 
11. Java Objects and classes
11. Java  Objects and classes11. Java  Objects and classes
11. Java Objects and classes
 
Java ppt
Java pptJava ppt
Java ppt
 
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
 
Simple Java Programs
Simple Java ProgramsSimple Java Programs
Simple Java Programs
 
Reading and writting v2
Reading and writting v2Reading and writting v2
Reading and writting v2
 
20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: Methods
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 

Similar to Java Tutorial: Part 1. Getting Started

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
 
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
 
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
 
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
 
Java Notes
Java Notes Java Notes
Java Notes
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.4sotlsoc
 
ma project
ma projectma project
ma projectAisu
 
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
 
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docxPT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
amrit47
 
Java
Java Java
Java practical
Java practicalJava practical
Java practical
william otto
 

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
 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diploma
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdf
 
00_Introduction to Java.ppt
00_Introduction to Java.ppt00_Introduction to Java.ppt
00_Introduction to Java.ppt
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPREC
 
Java Notes
Java Notes Java Notes
Java Notes
 
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
 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4
 
ma project
ma projectma project
ma project
 
07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt
 
ch01-basic-java-programs.ppt
ch01-basic-java-programs.pptch01-basic-java-programs.ppt
ch01-basic-java-programs.ppt
 
JAVA Programming notes.ppt
JAVA Programming notes.pptJAVA Programming notes.ppt
JAVA Programming notes.ppt
 
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdfJava Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdf
 
Oop lecture2
Oop lecture2Oop lecture2
Oop lecture2
 
1- java
1- java1- java
1- java
 
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docxPT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
 
Java
Java Java
Java
 
Java practical
Java practicalJava practical
Java practical
 

More from 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
 
IT Professions and Their Future
IT Professions and Their FutureIT Professions and Their Future
IT Professions and Their Future
Svetlin Nakov
 
How to Become a QA Engineer and Start a Job
How to Become a QA Engineer and Start a JobHow to Become a QA Engineer and Start a Job
How to Become a QA Engineer and Start a Job
Svetlin Nakov
 
Призвание и цели: моята рецепта
Призвание и цели: моята рецептаПризвание и цели: моята рецепта
Призвание и цели: моята рецепта
Svetlin Nakov
 
What Mongolian IT Industry Can Learn from Bulgaria?
What Mongolian IT Industry Can Learn from Bulgaria?What Mongolian IT Industry Can Learn from Bulgaria?
What Mongolian IT Industry Can Learn from Bulgaria?
Svetlin Nakov
 
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
Svetlin Nakov
 

More from Svetlin Nakov (20)

Най-търсените направления в ИТ сферата за 2024
Най-търсените направления в ИТ сферата за 2024Най-търсените направления в ИТ сферата за 2024
Най-търсените направления в ИТ сферата за 2024
 
BG-IT-Edu: отворено учебно съдържание за ИТ учители
BG-IT-Edu: отворено учебно съдържание за ИТ учителиBG-IT-Edu: отворено учебно съдържание за ИТ учители
BG-IT-Edu: отворено учебно съдържание за ИТ учители
 
Programming World in 2024
Programming World in 2024Programming World in 2024
Programming World in 2024
 
AI Tools for Business and Startups
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
 
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)
 
AI Tools for Entrepreneurs
AI Tools for EntrepreneursAI Tools for Entrepreneurs
AI Tools for Entrepreneurs
 
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
 
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
 
Дипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП - Светлин НаковДипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП - Светлин Наков
 
Дипломна работа: учебно съдържание по ООП
Дипломна работа: учебно съдържание по ООПДипломна работа: учебно съдържание по ООП
Дипломна работа: учебно съдържание по ООП
 
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
Свободно ИТ учебно съдържание за учители по програмиране и ИТСвободно ИТ учебно съдържание за учители по програмиране и ИТ
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
 
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
 
Programming Languages Trends for 2023
Programming Languages Trends for 2023Programming Languages Trends for 2023
Programming Languages Trends for 2023
 
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
 
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)
 
IT Professions and Their Future
IT Professions and Their FutureIT Professions and Their Future
IT Professions and Their Future
 
How to Become a QA Engineer and Start a Job
How to Become a QA Engineer and Start a JobHow to Become a QA Engineer and Start a Job
How to Become a QA Engineer and Start a Job
 
Призвание и цели: моята рецепта
Призвание и цели: моята рецептаПризвание и цели: моята рецепта
Призвание и цели: моята рецепта
 
What Mongolian IT Industry Can Learn from Bulgaria?
What Mongolian IT Industry Can Learn from Bulgaria?What Mongolian IT Industry Can Learn from Bulgaria?
What Mongolian IT Industry Can Learn from Bulgaria?
 
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
 

Recently uploaded

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 

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
  • 14.
  • 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); } }
  • 27.
  • 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

  1. 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.
  2. 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.
  3. 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.
  4. 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!
  5. 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.
  6. 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.
  7. 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.