
Hello and welcome to this course which is designated for absolutely for beginners where you are going to learn Java from scratch to advance. Java is the most popular language right now. And if you want to be a java developer then this course is for you. I am Sarkhan Rasullu, I am a developer working mainly in Java and JVM based languages and I am also responsible for architecting applications, databases and I have many years experience as a Java Trainer as well. I've written this course based on these experiences. On this course I'll be assuming no prior knowledge of Java or any programming language. You do not need to be a programmer, or you do not need to know any programming language. You just need to have an interest in programming in Java. On the course you'll be learning Java Basics, All of Object Oriented Programming Language concepts and along the way you'll be applying your new skills on different algorithmic problems.
But we will keep things simple at first. We will be learning about variables, classes, objects, methods, some most popular design patterns as singleton pattern, factory pattern and data structures. We'll apply these concepts on our simple applications that you can practice your skills. And meanwhile we will talk about interview questions that can be asked in interviews.
During the course we will talk about architecting and best practices as well.
I hope you will enjoy the course. The entire course is from Scratch to advance and if you are following along with me by the end of the course you will be ready to develop a Java application.
If you are not sure to enroll this course don't worry you have 30 days money back guarantee. If you feel that this course is not for you, or for some any reasons you want to cancel this course without any question, without any hassle you can refund your money.
We will download all requirements together that we need to begin coding in Java and begin to develop our first application step by step in the next lecture. So I'll see you in the next video.
New videos are continuously appending to your recently enrolled course. Approximately at the 15th minute of the course you will be asked for rate by 5 stars rating.
Try to give the highest rate and leave a review! In this way training will remain constantly up to date and students will get the newly added lessons for free.
You only need to purchase the training set once. You don't need to pay extra for newly added videos.
We wish you success in the way you are already on.
Best regards!
Hello and in this section we are going to have a look at JDK and IDE which we need to install to developing in Java and we are going to see what they do for us. As a JDK I am going to use JDK 1.8 and as an IDE I am going to use Eclipse. JDK stands for Java Development Kit which our application uses it in background and Eclipse is an environment which helps us to write code and build our application easily.
Let's start with downloading jdk 1.8. In browser google for jdk 1.8. You see here official oracle web page. Click on it and it will redirect you oracle downloads page.
Here be sure that you accepted license. And here different types of download links lister. According to your operating system type choose your download. I am going to show you If you are using windows how can you find your operting system type. In start menu right click on my computer and choose properties. Here you will find your Operating System type.
How can we install Eclipse?
Welcome back, in this tutorial we are going to create our first application in java. Steps are very easy just follow me and at the end of the lesson we will be created our first application in java. On the left up corner from menu choose file->new->java project, or on the left up corner you see a little icon, click on it and choose java project. This configuration page opens up. Here on the first line you see project name, I am calling project HelloWorld and highly recommend you that follow my steps exactly same as what I did, so you can fix if any problems occur in your computer easily.
And here it shows project location. by default it is using our workspace. I am keeping it same, not changing it. And here shows Java version which we installed before 1.8. And lastly hit on finish.
Amazing. Our First Project is created. In the next lesson I am going to show you how project structure is and we will write our first code togehter. See you in the next video.
It is getting more excited because in this tutorial we are going to analyze our application which we created before, write our first code and run it. On the left side you see our application which is waiting for us to analyze it. Click on this arrow. The application structure listed down like this. Here you see JRE which stands for Java Runtime Environment
We have a different lesson for JRE, so I am not going to talk about it now, but also we have src which stands for source folder. This folder is the main part of the application which our all source code files will be located in here.
And now I am creating our first source code file, which is called java file.
Right click on src folder and select new->class.
After that this window opens up and here it requires us to write class name. I am calling it Main.
You see here also the other fields like package name, modifiers, superclass etc. we will use them all as we need during the lessons, don't worry at all about them. And click on finish.
Yes our file is created. and file ends with .java extension as you see here. All our source files alwasys will be ended with .java extension because Java requires it so. Basically .java file is our source file which we are writing our source codes in here. At the same time we can have multiple .java files.
Now I am going to analyze Main.java file inside.
Here we have a source code that public class Main and braces opens and closes.
Our codes which we want to execute will be located within these braces, inside of this Main class
Now lets write our codes.
public static void main and within parenthesis String[] args and braces.
This line of code is the starting point of application. When we start our application this line of code and everything inside of these braces will be executed first.
As a last step inside of these braces I am going to write so simple but believe me so important line of code. System.out.prinlnt and within parenthesis "Hello World". This line of code is for printing text in console.
Here you see our console place. Our text will be printed here.
For running application right click on anywhere inside of file or on the left side right click on the file name and choose run as java application.
And as you see in console area "Hello World" printed. This step can be so simple step for us but believe me this step is very big and important step for Software Development, IT area that one person is growing up in Software Development area and that person is absolutely you and you did your first step just now.
In the next lesson we are going to write more codes in our application.
See you in the next lesson!
In this tutorial we are going to learn what are variables and data types.
Topic is so easy just follow me carefully.
Simply I am writing
x = 5;
Here x is a variable and 5 is a data which x stores. So here the type of our data is a whole number.
For now Java can not understand what type of data x stores and we have to write it explicitly before x variable. In our case x stores whole number and to say that our x stores whole number we have to write "int" before x variable. Always the type of the data comes before variable name.
int x = 5;
Here x is our variable, int is type of data that x can store and 5 is data of x variable.
Now you can ask that when I can use "variables" and how are these useful.
I am going to print 5 by using x variable.
System.out.println(x);
This line of code is printing value of our variable. Here be careful that I didn't write x within double quotes. I only wrote x and it prints value which x stores not letter "x".
And now I am declaring the second variable I am calling it y and stores 3 value.
and print it by using System.out.println(y);
And I am writing little bit different code it is adding 2 numbers. x and y and printing it.
System.out.println(x+y);
So basically as you see we are using variables to store data and use them as we need.
Of course in Java there are different kind of data types. We will see them in the next lesson. See you in the next video.
Let's continue to data types.
In Java there are multiple data types and in this tutorial we are going to see some of them and practice them one by one.
we have an integer int d = 4; and I am trying to assign a fractional number 4.5 to d variable.
Of course I got an error because integer means d only can store whole numbers but we are trying to assign fractional number.
To declare fractional numbers we have to use double data type.
So I am chaning int to double:
double d = 4.5;
To better understanding I am going to do some practice.
I declare second double variable
double d2 = 4.4;
and calculate sum of d2 and d3 and print it.
BTW I am going to show you the quick way of System.out.println. Just type sout and press ctrl+space. If you are using mac press option and space.
sout("d+d2");
sout(d+d2);
An other data type is char. Char is short version of character and char is for storing only one letter.
Let's declare
char c = 'e';
As you can see I wrote e between single quotes not double quotes like this:
char c = "e";
Here we can write any symbol we want instead of e. And we can not write more than one letter. If we do we will get an error like this.
In practice we are using char to get input from user and according to the input we can do some further operations. Think like calculator we press some symbol like '+','-' etc. and calculator does some operations like if symbol equals + do addition, or if symbol equals - do subtraction etc.
In the future lessons we will use this data type more and more don't worry at all. For now we have to get some basic knowledge about them. Don't worry at all.
The other data type which is so simple but very useful data type that every programmer is using it frequently. Always we need to know the result of some operations like send an email and tell me the result that could you send it? yes or no.
, or we need to know the result of some checking like is number a less than number b or something else. Yes or no. In programming instead yes we are using true and instead no we are using false.
And we have to store this true or false in a variable. This variable's type is boolean. Boolean data type only can store true or false. so sendEmail and tell me did you send it true or false, or is a number less than b, true or false.
Here I declare one boolean variable.
boolean b = true;// or false
Here we could also write false.
I can show you some simple practice:
int a1 = 2;
int a2 = 3;
boolean b = a1<a2;
is that true?
Here value of b is true; and according to this answer we can do some further operations that if b is true do something or if b is not true do some other operations.
For now we learned double, char and boolean. And we have additional data types, which we will learn in the next lesson. See you in the next video.
To declare whole numbers we are using int data type. But In Java for declaring whole numbers additionally there are different 3 data types as well. They are byte, short and long.
I declare variables for each of them to show you how can we use them.
int i = 1;
byte b = 1;
short s = 1;
long l = 1;
So we can assign whole number 1 to each of these data types. What is the difference between these types and where should we use them?
When we declare a variable allways we say that variable stores a value. Here b stores number 1. So What does "stores a value" sentence mean? To store means it keeps that value in somewhere. And of course to keep value it needs a memory. All of values are storing in RAM memory and according to our data types Java allocates different size of memory.
In this list you see all of whole number types, their sizes and their up and down limitations.
byte - 1 byte - Stores whole numbers from -128 to 127
short - 2 bytes - Stores whole numbers from -32,768 to 32,767
int - 4 bytes - Stores whole numbers from -2,147,483,648 to 2,147,483,647
long - 8 bytes - Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808
As you can see byte is the smallest data type and long is the biggest data type. In practice you should think about size that how much memory you need or you will need. For example you have some people list and you know that people count will be more than 127. In this of course you can't declare variable as byte. Because in case that you overflow 127 you will not be able to store that value. For example I am trying to assign 128 to byte b variable.
as you see I can't assign 128 to byte variable. Because the highest limit is 127.
Additionally I wanna talk about float data type. This data type is for declaring fractional numbers as well as we did before by using double.
The difference between double and float is the same as in whole number data types, the difference is allocated memory. Double takes more memory than float. In this list you see float and double and their up and down limitations:
float - 4 bytes - Stores fractional numbers from 3.4e−038 to 3.4e+038. Sufficient for storing 6 to 7 decimal digits
double - 8 bytes - Stores fractional numbers from 1.7e−308 to 1.7e+038. Sufficient for storing 15 decimal digits
Let's declare double d = 4.5; and float f = 4.5;
here in float declaration we have an error. Here we have pretty interesting reason to get this error. And We will see and fix this problem in the next lesson.
To better understand why we get an error here, hover your mouse to number and it shows you the error. Here actually we are trying to assign a fractional number to float number. But we get an error it says that cannot convert from double to float. Because by default in java when you write in anywhere in application a fractional number Java understands that number as a double. So actually we are trying to assign a double number to float and we get an error. The reason is double allocates 8 bytes memory but float can handle only 4 bytes memory. For example if we write here whole number you will not get error. 1 is whole number and whole number is known by Java by default as an integer and integer allocates 4 bytes memory and float can handle 4 bytes memory. But if we write here 1.0 we get an error because 1.0 is a fractional number and a fractional number by default is known as a double number. And float can't handle double. To fix this problem the first way is simply write here f, now Java understands as float number, or write here (float). It is highly recommended way. Because for example if I assign double d to f. I can't write here df, because that means I am looking for df variable. But I don't have such variable. Of course I have to write here (float). That's why this way is highly recommended way. For now we converted double to float. By the other word we are casting. And we can do this casting to other types. For example I am casting integer to byte, long to short, double to float.
We are casting int to byte and byte has less memory (1 byte) than int (4 bytes). That's why this casting is narrowing casting because we narrow the allocated memory from int to byte.
Also we can cast to float to double, short to long, byte to int. But when you assign to higher memory you don't need to explicitly casting. Because more memory type can handle less memory type.
We are casting byte to int, short to long, float to double. And int has more memory than byte, long has more memory than short, double has more memory than float. That's why this casting is widening casting. In widening casting you don't need explicitly casting. It is automatically casted by Java.
Because wide memory type can handle low memory value.
You can't assign double or float to any whole number type (byte, short, int, long) because of the fractional part of the value. Whole number type can not store fractional part but only can store whole part. That's why you have to cast explicitly.
Casting is converting one data type to an other one.
We need casting:
1. when we assign higher memory to lower memory
2. when we assign fractional number(double or float) to any whole number type(byte, short, int, long)
Simple but frequently we use it. What is arithmetic operator, what kind of arithmetic operators there are. How can we use it what is the best practice.
Frequently we need to compare values, what value client send me is it what I require? How can I compare them in Java. What is relational operator in Java, how can we use them. We will cover all relational operators in this tutorial.
== (equal to)
!= (not equal to)
> (greater than)
< (less than)
>= (greater than or equal to)
<= (less than or equal to)
We have many values and we need to compare each of it. If a equals 2 and b equals 4 and c equals 5 how can we compare them at the same time. Yes in this case we are using logical operators.
&&
||
!=
When we recieve a value we need to assign this value some variable to handle it. Otherwise we can not access it when we need it. There many assignment operators which make easy our work. Instead of a = a+2; isn't it good to use simply a+=2; of course yes. We will cover all assignment operators one by one, what is assignment operator in Java and how can we use it?
+=
-=
\=
*=
%=
When we need to do some operations many times repeatedly we are using for loop. What is for loop in Java, how can we use it, what is best practice we will cover each of it. Many people who uses for loop think that they know for loop in depth but it is not simple as they think. Be careful and focus on video well. Good luck!
Suppose I have one int a variable. If I want to store 1000 int variable what should I do? declare 1000 int variable? Of course not. I need to use arrays. What is arrays in Java, what kind of variables there are? What is one-dimensional array in Java, how can we use it what is best practice, how to iterate for-loop, how to fill and how to print
After knowing one dimensional array and what is for-each loop we can learn for-each loop in depth. How it works, why we need it, what is the difference between foreach and classic for-loop. When we should use for-each and for-loop in Java?
We have 5 length array, if you need 5x5 array how will you solve this problem, in this case you need multi-dimensional array.
What is multi-dimensional array in Java, how it works, how can we use it, how can we iterate, fill and print array in Java.
The other kind of loop in Java is while and do-while. What is the difference between while and loop. What is the difference between while and do-while. How can we use while and do-while in Java, what is the best practice
You need to do some operations according to what value you receive. In this case we can use if but it is not optimal. The best way in this case is switch-case. What is switch-case in Java, how to use switch-case in Java and what is the best practice.
One of the most important topics of Java and all OOP programming languages. Methods! To operate many operations at the same and many times we collect operations in one place and call it as many times we want. This place is called method. What is method in Java, how to use methods in Java, what kind of methods there are in Java :methods with parameters, methods without parameters, methods receive parameter, methods don't receive parameter and what are the best practices of methods in Java.
We talked about variables and methods. During this period many times we saw "static" keyword. In this video you will learn what is local variable and local method, static variable and static method, instance variable and instance method in Java and what is the best practice.
Till now you saw many times and write your code always inside of it. That was class. In Java every code you have to write inside of class. Now you will learn what is class in Java, how to use class, how to call other class in Java
What is a Class
How can we call other classes methods and variables
In real world we are classifying our stuffs to prevent confusion. For example in kitchen we are classifying cups at one place, drinks at one place etc. In Java we are classifying our classes in packages to prevent confusion about which class does which job.In this video you will learn what is package in Java, how to use it, why we need package, what is the best practice to use packages in Java.
Many times we saw public, private keywords during development. These are access modifiers. In this tutorial you will learn What is access modifier in Java, what kind of access modifiers are there and what are they for, how to use them?
public, private, default, protected
What is non-access modifier?
static, final, synchronized, abstract etc.
Now you know that what is static keyword for and how to use it. Now time is for to see some existing static methods of existing classes of Java. String, Integer, Float, Double, Long, Boolean, Math exist in Java and you can use them when you need it. There are bunch of static methods inside of these classes useful. In this tutorial we will see these methods and usage of them.
By knowledge you learned till now you can develop an application which can calculate 2 numbers. But how can you receive inputs a and b values from user. User wants to send you 2 number and wants to calculate it. In this tutorial you will learn how to receive inputs from user by Scanner class in Java.
User enters a number and application must find and print all numbers which can be divided by 2 between zero and that given number.
For example:
Our given number is 5
Answer must be 0,2,4. Because each of these numbers can be divided by 2
Hint: use % and / operators
It is time to mix all of knowledge you got. In this tutorial you will practice everything you learned till now by doing calculator app step by step with me. So focus on video and don't be hurry step by step do coding with me I will explain each steps while I am coding. Good luck!
Now you know what is an Object. It means you can learn the difference between int - Integer, float - Float etc.
You know what is a Class, how to import it. Did you think that we are using a "String,Integer,Float,Double classes,". If we need to have a class to import it, it means these classes exist in somewhere that we can use it (even without an import). But how? Here is the reason inside of the JDK!
New tutorial is on way!
A course on Java for complete beginners to computer programming, for those who want to learn Java from Beginner to Advance.
Hello and welcome to this course which is designated for absolutely for beginners where you are going to learn Java from scratch to advance. Java is the most popular language right now. And if you want to be a java developer then this course is for you. I am Sarkhan Rasullu, I am a developer working mainly in Java and JVM based languages and I am also responsible for architecting applications, databases and I have many years experience as a Java Trainer as well. I've written this course based on these experiences.
On this course I'll be assuming no prior knowledge of Java or any programming language. You do not need to be a programmer, or you do not need to know any programming language. You just need to have an interest in programming in Java. On the course you'll be learning Java Basics, All of Object Oriented Programming Language concepts and along the way you'll be applying your new skills on different algorithmic problems.
But we will keep things simple at first. We will be learning about variables, classes, objects, methods, some most popular design patterns as singleton pattern, factory pattern and data structures. We'll apply these concepts on our simple applications that you can practice your skills. And meanwhile we will talk about interview questions that can be asked in interviews.
During the course we will talk about architecting and best practices as well.
I hope you will enjoy the course. The entire course is from Scratch to advance and if you are following along with me by the end of the course you will be ready to develop a Java application.
If you are not sure to enroll this course don't worry you have 30 days money back guarantee. If you feel that this course is not for you, or for some any reasons you want to cancel this course without any question, without any hassle you can refund your money.
We will download all requirements together that we need to begin coding in Java and begin to develop our first application step by step.
Teaching is not only talking about topics, terms but also teaching the logic and attract the student's psychology
I have 6 years experience as a Java Developer with a lot of projects and 3 years experience as a Java Trainer. Love to share my knowledge with someone and be happy to see someone got a job with my training. My teaching style is not like "memorizing some rules", I teach the reasons and logic! Hope this tutorial set will be the best in Java Udemy Courses. Let me introduce what you will learn at the end of course.
In this course you will learn
What is Java?
How to programming in Java (Java 1.8)
Object Oriented Programming (From Fundamentals to Advanced)
How Java can understand us, How computer can understand Java
Best Practices - How to use Object Oriented Programming in an Efficient Way
How to write efficient Java Programs
How to design an Application
You will get source code at the end of each tutorial