Java Training Tutorials
Java Training Tutorials
1
A GUIDE TO JAVA COURSE CURRICULUM AND SYLLABUS!
Java is among the top computer languages used for web, mobile, desktop applications, etc.
It is a programming language based on the concept of Object-Oriented Programming Systems (OOPS).
2
1. What is Core Java?
The term “core” refers to the fundamental notion of anything, while the phrase “Core Java” refers to the fundamental concept of the Java
programming language.
We are all aware that Java is one of the most well-known and frequently used programming languages, and that a novice should begin with
Core Java and work their
way up to Advance Java. The Java programming language is a general-purpose programming language based on the object-oriented
programming (OOPs)
paradigm. Java’s ocean is too deep to learn, i.e., the more you study, the deeper it becomes. Java is a powerful and platform-independent
programming language. J
ava follows the WORA philosophy, which stands for Write Once, Run Anywhere. The programming language is straightforward and simple
to grasp.
However, it is important to note that Core Java is not the same as Java. Although Java is self-contained, it is normal for newcomers to start
with the fundamentals of t
he language. In reality, there are several editions of Java, with Core Java being one of them.
2. Java Editions
The Java Programming Language supports the following declared editions:
Java SE (Java Standard Edition) Java SE is a computer platform that may be used to create desktop or Windows-based applications.
Thus, core Java is a portion of Java SE in which developers create desktop-based programmes utilising Java’s
fundamental ideas, with JDK (Java Development Kit) being a well-known Java SE implementation.
Java EE (Java Enterprise Edition) Also known as J2EE or Java 2 Platform. It is the enterprise platform on which a developer creates
applications for servers, i.e. enterprise development. This is the edition for web development.
Java ME (Java Micro Edition) It is the tiny version that is used for mobile phone application development. As a result, Java ME is
required for the creation of mobile apps. As a result, Core Java is clearly a part of Java SE, and Java SE serves
as the foundation for all subsequent Java versions.
3
3. Concepts in Core Java
The following are some of the most important Java fundamental topics:
Java Fundamentals
OOPs Concepts
Overloading & Overriding
Inheritance with Interface and Abstract Class
Exception Handling
Packages
Collections
Multithreading
Swings
Applets
JDBC (Basic Database Connections)
4.10 Difference between static variable and instance variable, static method, and instance method, static block, and instance block
Final Keyword
Final keyword
Final variable
Final method
Final class
5
4.13 Encapsulation
Encapsulation in Java
How to achieve encapsulation
Data Hiding
Tightly encapsulated class
Getter and setter method in Java
Naming convention of getter and setter method
4.14 Inheritance
Inheritance in Java
Is-A-Relationship
Aggregation and Composition
Types of Inheritance
4.15 Polymorphism
Polymorphism in Java
Types of Polymorphism
Static and Dynamic Binding
Method overloading]
Method Overriding
4.16 Abstraction
Abstraction in Java
Abstract Class
Abstract method
Interface in Java
Nested interface, rules, and example programs
Java Introduction:
What is Java?
Java is a popular programming language, created in 1995.
It is owned by Oracle, and more than 3 billion devices run Java.
It is used for:
Mobile applications (specially Android apps)
Desktop applications
Web applications
Web servers and application servers
Games
Database connection
And much, much more!
7
Java Quickstart
In Java, every application begins with a class name, and that class must match the filename. Let's create our first
Java file, called Main.java, which can be done in any text editor (like Notepad). The file should contain a "Hello
World" message, which is written with the following code:
8
Java Syntax
In the previous chapter, we created a Java file called Main.java, and we used the following code to print "Hello World" to the screen:
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Every line of code that runs in Java must be inside a class. In our example, we named the class Main.
A class should always start with an uppercase first letter.
Note: Java is case-sensitive: "MyClass" and "myclass" has different meaning.
The name of the java file must match the class name. When saving the file, save it using the class name and add ".java" to the end of the
filename.
The main Method
The main() method is required and you will see it in every Java program:
public static void main(String[] args)
Any code inside the main() method will be executed.
System.out.println()
Inside the main() method, we can use the println() method to print a line of text to the screen:
public static void main(String[] args) {
System.out.println("Hello World");
}
Note: The curly braces {} marks the beginning and the end of a block of code. System is a built-in Java class that contains useful members,
such as out,
which is short for output". The println() method, short for "print line", is used to print a value to the screen (or a file).
9
Java Output / Print
Print Text
You learned from the previous chapter that you can use the println() method to output values or print text in Java:
System.out.println("Hello World!");
You can add as many println() methods as you want. Note that it will add a new line for each method:
Example
System.out.println("Hello World!");
System.out.println("I am learning Java.");
System.out.println("It is awesome!");
Double Quotes
When you are working with text, it must be wrapped inside double quotations marks "".
If you forget the double quotes, an error occurs:
Example
System.out.println("This sentence will work!");
System.out.println(This sentence will produce an error);
The Print() Method
There is also a print() method, which is similar to println().
The only difference is that it does not insert a new line at the end of the output:
Example
System.out.print("Hello World! ");
System.out.print("I will print on the same line.");
Note that we add an extra space (after "Hello World!" in the example above), for better readability.
10
Java Output Numbers
Print Numbers
You can also use the println() method to print numbers.
However, unlike text, we don't put numbers inside double quotes:
Example
System.out.println(3);
System.out.println(358);
System.out.println(50000);
You can also perform mathematical calculations inside the println() method:
Example
System.out.println(3 + 3);
Example
System.out.println(2 * 5);
11