
Quick Contact
Java Tutorial
- What is Java?
- History of Java
- Hello Java Program
- Features of Java
- Basic Syntax
- Java Setup
- Data Types in Java
- Java Variables
- Operators in Java
- JVM
- Java If-else Statement
- Switch Case Statement
- Java Loops
- Do-While Loop
- Java While Loop
- Continue Statement
- Break Statement in Java
- Constructors in Java
- Oops Concept in Java
- Features of OOPs
- Inheritance
- Exeception handeling
- Aggregation (HAS-A relationship) in Java
- Method Overriding in Java
- Method Overloading
- Java Static Keyword
- Java This Keyword
- Java Final Keyword
- Polymorphism
- Static Binding and Dynamic Binding
- Abstract class in Java
- Access Modifiers in Java
- Difference between abstract class and interface
- Interface in Java
- Garbage Collection in Java
- Java Package
- Encapsulation
- Serialization and Deserialization in Java
- Java Inner Classes
- Java Applets
- Multithreading in Java
- Thread Priorities in Java
- Thread Creation
- Inter Thread Communication
- Wrapper Classes in Java
- Java Input Output
- Java AWT Introduction
- Java Layout Manager
- Java Layout Policy
- Java AWT Events
- Collection Framework
- Collection Framework List Interface
- Swing in Java
- Swing Utility Classes
- Swing Layout Managers
- Java JDBC
- Hibernate Framework Overview – Architecture and Basics
Springboot
- Spring Environment Setup
- Spring Boot CRUD REST API Project using IntelliJ IDEA | Postman | MySQL
- Dockerizing Spring Boot Application | Spring Boot Docker Tutorial
- spring-boot-restapidocumentation with swagger
- Spring Boot HttpClient Overview
- Apache HttpClient POST HTTP Request Example
- Apache HttpClient PUT HTTP Request Example
- Apache HttpClient DELETE HTTP Request Example
- Apache HttpClient HTML Form POST Request Example
- Spring Boot JSP Exampl
- Deploying Spring Boot WAR file with JSP to Tomcat
- Spring Boot Annotations
- Spring Core Annotations
- Spring MVC Annotations with Examples
- Spring Scheduling Annotations
- Spring - Java-based Container Configuration
- Spring Java Based Configuration Example
Hibernate
- Hibernate 5 hello world
- Hibernate- One to One Unidirectional Mapping Annotation Example
- Hibernate - Batch Processing
- Hibernate - Interceptors
- Hibernate 5 - Create, Read, Update and Delete (CRUD) Operations Example
- Hibernate Transaction Management
- Hibernate One to Many Unidirectional Mapping Example
- Hibernate One to Many Bidirectional Mapping Example
- Hibernate Many to Many Annotation Mapping Example
- Hibernate Primary KeyJoin Column
- Hibernate First Level Cache with Example
- Hibernate XML Configuration Example with Maven + Eclipse + MySQL Database
- Hibernate Java Configuration Example
- JPA 2 with Hibernate 5 Bootstrapping Example
- JPA and Hibernate Cascade Types
- Hibernate/JPA - Primary Key Generation
- Hibernate 5 - Enum Type Mapping Example
- Hibernate Component Mapping
- Hibernate Object States – Transient,Persistent and Detached
- Hibernate 5 - Save an Entity Example
- Hibernate 5 - Persist an Entity Example
- Hibernate 5 - saveOrUpdate() Method Example
- Hibernate 5 - get(), load() and byId() Method Examples
- Hibernate 5 - merge() Example
- Hibernate 5 - Delete or Remove an Entity Example
- Hibernate 5 - load() Method Example
- Hibernate Session Interface Methods
- Hibernate Session.clear() Method Example
- Introduction Of Java strutes to Architecture
- Struts 2 - Architecture
- Struts 2 - Configuration Files
- Struts 2 - Actions
- Struts 2 - Interceptors
- Struts 2 - Results & Result Types
- Struts 2 - Value Stack/OGNL
- Struts 2 - File Uploading
- Struts 2 - Database Access
- Struts 2 - Validations Framework
JAVA FX
- JavaFX Tutorial
- Introduction to JavaFX Pane
- JavaFX Popup
- JavaFX group
- JavaFX Controller
- JavaFX Gradient Color
- JavaFXAnchorPane
- JavaFXTabPane
- JavaFX Scene
- JavaFX Stage
- JavaFXWebView
- JavaFX Timeline
- JavaFX Timer
- JavaFX Image
- JavaFX Background
- JavaFX dialog
- JavaFX Font
- JavaFXTextArea
- JavaFXObservableList
- JavaFX GUI
- JavaFX FXML
- JavaFXEventHandler
- JavaFXGradle
- JavafxScrollpane
- JavaFXAPI
Java Loops
Loops are used to execute a set of functionality again and again till the condition turn into accurate. In java, there are three types of loops:
- for loop
- while loop
- do-while loop
The for loop statement is the most used, but while and do-while have their uses as well.
for loop
In java for loop is used to repeat the part of the program many times. If the number of repetition is fixed, then for loop is use.
while loop
In java while loop is used to repeat the part of the program many times. If the number of repetition is not fixed, then while loop is use.
do-while loop
In java do-while loop is used to repeat the part of the program many times. If the number of repetition is not fixed and need to execute loop at least once.
For Loop
In java for loop is used to repeat the part of the program many times. If the number of repetition is fixed, then for loop is use. For loop is recommended for iterating on objects like arrays and lists that can be counted.
Syntax
for(initialization; condition ; increment/decrement)
{
statement(s);
}
Flowchart
-
Initialization
An initialization expression that sets the initial value of the counter used by this loop. It executes only once when the loop starts.
-
Condition
It execute each time to test the condition. In condition of the loop, as long as this condition is evaluated to true, the loop will continue executing.
-
Statement
In statement, it executed every time until the second condition is false.
-
Increment/Decrement
Example
class ForExample {
public static void main(String[] args) {
//Code of Java for loop
for(int i=1;i<=8;i++){
System.out.println(i);
}
}
}
Output
1
2
3
4
5
6
7
8
Nested for Loop
When for loop is inside of another loop, then it is called nested for loop. Whenever outer loop executes inner loop also executes completely.
Example
class NestedForloop {
public static void main(String[] args) {
//loop of i
for(int i=A;i<=C;i++){ //loop of j
for(int j=A;j<=C;j++){
System.out.println(i+” “+j);
} //end of i
} //end of j
}
}
Output
A A
A B
A C
B A
B B
B C
C A
C B
C C
Pyramid Example
class PyramidExample {
public static void main(String[] args) {
for(int i=1;i<=6;i++){
for(int j=1;j<=i;j++){
System.out.print(“1 “);
}
System.out.println(); //new line
}
}
}
Output
1
1 1
1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1 1
For-each Loop
For-each loop is used to navigate array. It is easy to use than simple for loop. It does not need to increment value and use subscript notation.
It deals with components premise, not file. It returns component individually in the characterized variable.
Syntax
for(Type var:array){
//code to be executed
}
Example
class ForEachExample {
public static void main(String[] args) { //Declare an array
int arr[]={11,22,33,44,55}; //Print array using for-each loop
for(int i:arr){
System.out.println(i);
}
}
}
Output
11
22
33
44
55
Infinitive for Loop
Use of two semicolons ; ; in for loop is called infinitive for loop.
Syntax
for(; ;){
//code to be executed
}
Example
class ForExample {
public static void main(String[] args) {
//Using no condition in for loop
for(;;){
System.out.println(“infinitive for loop”);
}
}
}
Output
infinitive loop
infinitive loop
infinitive loop
infinitive loop
infinitive loop
ctrl+c
Ctrl+c is use to exit the program
Apply now for Advanced Java Training Course