Check out the course: https://www.duckademy.com/course/java-programming Learn Java from scratch in an easy and entertaining way. The Easy-to-follow Java programming course on Duckademy was made for beginners. In this course we start at the very basics (from zero) and go through lots of interesting exercises and analogies that will take you to an advanced level. By the end of the course you will have all the knowledge needed to move on and specialize in Java. The course is easy to follow and things are well explained. Furthermore, to make your learning easier and more enjoyable throughout the course we will develop a nostalgic, text-based fantasy game.
The course is recommended to anyone who wants to learn Java. Ideal for those who are new to programming, but it can be useful and enjoyable for people who want to switch to Java from a different programming language.
By the end of the course you will be able to build simple, but fully functional programs. You will also gain all the knowledge needed to specialize in Java and become a well-payed Java expert later on.
Check out the course: https://www.duckademy.com/course/java-programming
3. The goal of this course is to teach you how to
program in Java. From the very basics, through
lots of exercises, you will get to an advanced level
where you can become an expert Java developer.
4. The course will cover
Getting started with Java Sorting elements in Java
Control structures Generics
NetBeans tips and tricks Variations for storing objects
Basic algorithms Handling exceptions
Arrays File handling
Functions and structured
programming
Enums
Object-oriented programming in
Java
Using external libraries in our
programs
Handling dates and times
5. In this video
1. A quick intoduction to Java
2. Install NetBeans
3. Create our first project (Hello, World!)
4. Variables and types
5. Input/output and calculations
6. Conditions (if)
7. Review exercise
7. In the TOP 3 (if not the most popular)
3 billion devices run…
Platform independency (write
once, run anywhere)
Lots of well paying jobs
Wide usability
Java is popular
12. Basic computer skills
Programming
in Java
Basic
Java
tools
Mobile
apps
Android
Java ME
(cards, TV…)
Android has
the highest,
60% market
share among
mobile
platforms
worldwide.
13. Basic computer skills
Programming
in Java
Basic
Java
tools
Mobile
apps
Desktop
apps
Android
Games
Java ME
(cards, TV…)
Software
tools
Scientific
research
14. Basic computer skills
Programming
in Java
Basic
Java
tools
Mobile
apps
Desktop
apps
Enterprise
(”web”) apps
Android
Games
Java ME
(cards, TV…)
90% of
Fortune 500
companies
use Java.
Software
tools
Banks
Scientific
research
E-commerce
applications
Backend
services
15. Basic computer skills
Programming
in Java
Basic
Java
tools
Mobile
apps
Desktop
apps
Enterprise
(”web”) apps
Android
Games
Java ME
(cards, TV…)
Software
tools
Programming
in Java
Banks
Scientific
research
E-commerce
applications
Backend
services
Basic
Java
tools
In this course
58. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
59. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer
60. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer Real
61. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer Real
Byte
62. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer Real
ByteShort
63. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer Real
ByteShort
Long
64. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer Real
ByteShort
LongInt
65. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer Real
ByteShort
LongInt
Float
66. Java variables and types
All typesPrimitive types ClassesNumbers
Char
Boolean
Integer Real
Long
ByteShort Float
DoubleInt
67. Replace the value of 2 variables!
Don’t write numbers!
Don’t change the existing lines, only include new ones!
public class Replace {
public static void main(String[] args) {
int first = 7;
int second = 19;
// write something here!!!
System.out.println(”first=”+first+”
second=”+second);
}
}
Value replacing exercise
77. Temperature exercise
Write a program that reads in an integer value
denoting a temperature value in Celsius grade.
Calculate and print the Fahrenheit grade!
What do we not know?
– How to read in a number
– How to make calculations
°F =
9
5
°C + 32
78. Boiling exercise
Write a program that reads in a temperature value
(in Celsius) and prints out if the water is boiling
at the specified temperature!
What do we not know?
– How to run a part of code based on a condition
100 °C
79. Boiling and freezing exercise
Write a program that reads in a temperature value (in
Celsius), and prints out whether the water is boiling or
freezing or at normal state at the specified
temperature!
What do we not know?
– Joining if’s
0 °C 100 °C
82. True, if both conditions are true.
Logic operators
&&
||
!
83. True, if both conditions are true.
True, if either condition is true.
Logic operators
&&
||
!
84. True, if both conditions are true.
True, if either condition is true.
Negate:
Logic operators
&&
||
! makes true out of false
85. True, if both conditions are true.
True, if either condition is true.
Negate:
Logic operators
&&
||
!
and false
makes true out of false
out of true.
95. Fighting exercise
Write a program with which you
can simulate one round of fight
between you and a monster.
First we read in the attributes
of each of you.
Then we play one round of the
fight.
Peter Tikos
96. Fighting rules
Attributes:
Attack Points (AP)
Defense Points (DP)
Damage (D)
Life Points (LP)
Fight (one round):
Attacker is chosen randomly (coin toss)
Attack Points + 2 Dice ? Enemy’s Defense Points
> : Attacker hits defender, so life points decreased by damage
<= : Miss
98. Let’s fight!
First let’s generate random numbers!
Then we are ready to fight
99. What’s next
Choose one from many (switch)
Repeat it! (the loops)
– While
– Do-while
– For
Controlling loops
– Break
– Continue
Multiple loops one inside the other
www.duckademy.com/course/java-programming
Check out the course:
100. End of video 1
Next video:
Control structures
www.duckademy.com/course/java-programming
Check out the course: