Java Basic/Advanced

  • /
  • Courses

Duration

25 hours

Course Price

$ 399.00

4.5 (23)

Overview

Course Content

 

1. Introduction To JAVA

  • Introduction to JDK, JRE
  • Oops Concepts
  • Java Installation

2. Basics Of Java

  • DataTypes
  • Variable Declaration
  • User Input
  • Branching
  • Looping Concepts
  • Conditional Statement
  • Concatenation Operator
  • Local & Global Variable
  • Static Variable
  • Packages
  • Object
  • Static & Non Static Concepts
  • Object Reference
  • Pass by Value
  • Pass by Reference
  • Constructor
  • Overloading
  • This Keyword
  • What is Class?
  • Polymorphism
  • Inheritance
  • Overriding
  • Final Class
  • Final Variable
  • Final Method
  • Interface
  • Abstraction
  • Encapsulation
  • ArrayList
  • Convert DataTypes (String To Integer, Integer to String)

3. Exception Handling

  • Concepts of Exception Handling
  • Try
  • Catch
  • Finally
  • Throws
  • Types of Exceptions

4. Java Collections

  • HashTable
  • List
  • Map
  • Set – Search
  • Sorting Algorithm

5. More Advanced Concept in Java

  • Thread
  • Data-Structure with Java
  • Stack
  • Queue,
  • Linked List
  • Double Linklist
  • Binary Search Tree

6. Database Connectivity

  • Java Database Connectivity (JDBC)
  • Transaction management in JDBC
  • Building Programming skills
  • Project Setup
  • Compilation
  • Deployment

7. J2EE

  • Java Servlets
  • JavaServer Pages (JSP)
  • Life Cycle of JSP and Servlets
  • Session Managements in J2EE Applicatoin
  • Filters
  • Application Server Introduction and Setup
  • J2EE Application
  • Execution of J2EE Application
  • Tag Libraries
  • Project Setup, Compilation & Deployment
  • Introduction of various design patterns mainly MVC

8. Struts

  • Overview of the Java Servlet and JavaServer Pages Architectures
  • Overview of Project Set up with Struts
  • Actions and ActionServlet
  • Advanced Action Classes
  • Building the Presentation Layer
  • Debugging Struts Applications
  • Managing Errors
  • Creating a small project using Struts

9. Hibernate

  • What is Hibernate
  • Hibernate Introduction
  • Mapping And Configuration Files In Hibernate
  • Where To Download, How To Install Hibernate
  • Hibernate Hello World Program in Eclipse
  • CRUD using Hibernate
  • Inheritance Mapping In Hibernate
    • Table Per Class Hierarchy
    • Table Per SubClass Hierarchy
    • Table Per Concrete Class Hierarchy
  • Composite Primary Keys In Hibernate
  • Hibernate One to Many Mapping Insert Query Example
  • Hibernate One to Many Mapping Delete Query Example
  • Hibernate One to Many Select Query Example
  • Hibernate Many to One Mapping Insert Query Example
  • Hibernate Many to One Mapping Select Query Example
  • Hibernate Many to One Mapping Delete Query Example
  • Hibernate One To Many Bidirectional Mapping Example
  • Hibernate Many to Many Mapping Example
  • Hibernate One to One Mapping Example
  • Hibernate Cascade Options – Cascade Attribute In Hibernate
  • Joins In Hibernate
  •  Hibernate Criteria Query
  • Hibernate Projections
  • Hibernate Named Query
  • Difference Between Merge And Update Methods In Hibernate
  • Difference Between Hibernate Save And Persist Methods
  • Project development using above topics

10. SPRING

  • What Is Spring Framework
  • Spring Introduction
  • Spring Modules, What Are Spring Modules
  • Spring Core Module
  • Spring IOC Tutorial
  • Dependency Injection In Spring Framework
  • Spring Framework Installation
  • Setter Injection With Objects, Spring Dependency In The Form Of Objects
  • Example On Spring Dependency In The Form Of Objects
  • Setter Injection, Dependency In The Form Of Collections
  • Spring Dependency Injection With Set Collection Property
  • Spring Dependency Injection With List Collection Property
  • Spring Dependency Injection With Map Collection Property
  • Constructor Injection In Spring [ Full Concept ]
  • Difference between Setter Injection and Constructor Injection
  • Spring Bean AutoWiring Tutorial
  • Spring JDBC Complete Introduction
  • Spring JdbcTemplate
  • spring and Hibernate (a workable project)
  • Spring AOP(Aspect Oriented Programming)

11. Live Project

  • Spring MVC
  • Working on Live Project

 

 

Trainer Profile

Interview Questions & Answer

1)  What do you understand by Java?

  • Java is an object-oriented computer language.
  • It is a high-level programming language developed by James Gosling in Sun Microsystems in the year 1995.
  • Java is a fast, secure, and reliable language used for many games, devices, and application.

 

2) What are the major Java features.

  • Object-oriented: Java is an object-oriented programming language where the class and methods describe the state and behavior of an object.
  • Portable: A Java program gets converted into Java bytecodes that can be executed on any platform without any dependency.
  • Platform independent: Java works on the ‘write once, run anywhere’ principle as it supports multiple platforms like Windows, Linux, Mac, Sun Solaris, etc.
  • Robust: Java has strong memory management as there are no pointer allocations. It has an automatic garbage collection that prohibits memory leaks.
  • Interpreted: As mentioned, Java compiler converts the codes into Java bytecodes which are then interpreted and executed by Java Interpreter.

 

3) What do you mean by an object?

An instance of a class is called an object. An object consists of methods and classes that depict its state and perform operations. A Java program contains a lot of objects instructing each other their jobs. This concept is part of core Java. The object has state and behavior.

Whenever the JVM reads the “new()” keyword then it will create an instance of that class.

Example:

public class Addition{

public static void main(String[] args){

Addition add = new Addition();//Object creation

}

}

The above code creates the object for the Addition class.

 

4) What is a class in Java?

All Java codes are defined in a Class. Java encapsulates codes in various classes that define new data types. These new data types are used to create objects. It has variables and methods.

Variables are attributes which define the state of a class.

Methods are the place where the exact business logic has to be done. It contains a set of statements (or) instructions to satisfy the particular requirement.

Example:

public class Addition{ //Class name declaration

int a = 5; //Variable declaration

int b= 5;

public void add(){ //Method declaration

int c = a+b;

}

}

 

5) Differentiate between JDK, JRE, and JVM.

  • JVM stands for Java Virtual Machine. It provides the runtime environment for Java bytecodes to be executed.
  • JRE (Java Runtime Environment) which includes the sets of files required by JVM during runtime.
  • JDK (Java Development Kit) consists of JRE along with the development tools required in order to write and execute a program.

 

6) What are the OOPs concepts?

OOPs concepts include:

  • Inheritance
  • Encapsulation
  • Polymorphism
  • Abstraction
  • Interface

 

7) What is Inheritance?

Inheritance means one class can extend to another class. So that the codes can be reused from one class to another class. The existing class is known as the Super class whereas the derived class is known as a sub class. Inheritance lets a derived class inherit the methods of a base class.

Example:

Super class:

public class Manupulation(){

}

Sub class:

public class Addition extends Manipulation(){

}

Inheritance is applicable for public and protected members only. Private members can’t be inherited.

 

What is Encapsulation?

 The Purpose of Encapsulation is:

  • Protects the code from others.
  • Code maintainability.

Example:

We are declaring ‘a' as an integer variable and it should not be negative.

public class Addition(){

int a=5;

}

If someone changes the exact variable as “a = -5” then it is bad.

 

In order to overcome the problem we need to follow the below steps:

  • We can make the variable as private or protected one.
  • Use public accessor methods such as set and get.

So that the above code can be modified as:

public class Addition(){

private int a = 5; //Here the variable is marked as private

}

The below code shows the getter and setter.

Conditions can be provided while setting the variable.

get A(){

}

set A(int a){

if(a>0){// Here condition is applied

.........

}

}

For encapsulation, we need to make all the instance variables as private and create setter and getter for those variables. Which in turn will force others to call the setters rather than access the data directly.

 

8) What is Polymorphism?

 Polymorphism means many forms.

A single object can refer to the super-class or sub-class depending on the reference type which is called polymorphism.

Example:

Public class Manipulation(){ //Super class

public void add(){

}

}

public class Addition extends Manipulation(){ // Sub class

public void add(){

}

public static void main(String args[]){

Manipulation addition = new Addition();//Manipulation is reference type and Addition is reference type

addition.add();

}

}

 

9) What is meant by Interface?

 Multiple inheritances cannot be achieved in java. To overcome the problem of multiple inheritance, Interface concept is introduced.

An interface is a template which has only method declarations and not the method implementation.

 

10) Explain method overloading.

When a Java program contains more than one method with the same name but with different properties, then it is called as method overloading.

 

11) Why do we use a vector class?

A vector class provides the ability to execute a growable array of objects. A vector proves to be very useful when you don’t know the size of the array in advance or if we need one that can change the size over the lifetime of a program.

 

12) What is meant by Exception?

 An Exception is a problem which could occur during the normal flow of execution. A method can throw an exception when something wails at runtime. If that exception couldn’t be handled, then the execution gets terminated before it completes the task.

If we handled the exception, then the normal flow gets continued. Exceptions are a subclass of java.lang.Exception.

Example for handling Exception:

try{

//Risky codes are surrounded by this block

}catch(Exception e){

//Exceptions are caught in catch block

}

 

 

 

13) What are the types of Exceptions?

 There are two types of Exceptions. They are explained below in detail.

A) Checked Exception:

These exceptions are checked by the compiler at the time of compilation. Classes that extend Throwable class except Runtime exception and Error are called checked Exception.

Checked Exceptions must either declare the exception using throws keyword (or) surrounded by appropriate try/catch.

For Example, ClassNotFound Exception

B) Unchecked Exception:

These exceptions are not checked during the compile time by the compiler.  The compiler doesn’t force to handle these exceptions. It includes:

  • Arithmetic Exception
  • ArrayIndexOutOfBounds Exception

 

14) What are the different ways to handle exceptions?

Two different ways to handle exception are explained below:

a) Using try/catch:

A risky code is surrounded by try block. If an exception occurs, then it  is caught by the catch block which is followed by the try block.

Example:

class Manipulation{

public static void main(String[] args){

add();

}

Public void add(){

try{

addition();

}catch(Exception e){

e.printStacktrace();

}

}

}

b) By declaring throws keyword:

At the end of the method, we can declare the exception using throws keyword.

Example:

class Manipulation{

public static void main(String[] args){

add();

}

public void add() throws Exception{

addition();

}

}

 

 

 

15)  What are the advantages of Exception handling?

 The advantages of exception handling are as follows:

  • The normal flow of the execution won’t be terminated if exception got handled
  • We can identify the problem by using catch declaration

 

  16) What are the Exception handling keywords in Java?

  Below are the Exception Handling Keywords:

a) try:

When a risky code is surrounded by a try block. An exception occurring in the try block is caught by a catch block. Try can be followed either by catch (or) finally (or) both. But any one of the blocks is mandatory.

b) catch:

This is followed by try block. Exceptions are caught here.

c) finally:

This is followed either by try block (or) catch block. This block gets executed regardless of an exception. So generally clean up codes are provided here.

 

17) What is lazy loading in hibernate?

Lazy loading is a kind of setting that decides whether to load the child entities along with the parent entities or not. When enabling this feature, the associated entities will be loaded only when they are requested directly. The default value of this setting is ‘true’ which stops the child entities from loading.

 

18) How can we fetch records using Spring JdbcTemplate?

We can fetch records from the database by the query method of JdbcTemplate. There are two interfaces to do this:

  1.  ResultSetExtractor
  2.  RowMapper

 

19) Which is the front controller class of Spring MVC?

The Dispatcher Servlet class works as the front controller in Spring MVC.

 

20) What are the states of an object in hibernate?

The states of an object in hibernate are:

  1. Transient: The objects that are just created having no primary key are in a transient state. Here the objects are associated with any session.
  2. Persistent: When the session of an object is just opened and its instance is just saved or retrieved, it is said to be in a persistent state.
  3. Detached: When the session of an object is closed, it is said to be in a detached state.

 

21) How to make an immutable class in hibernate?

If we mark a class as mutable=”false”, the class will be treated as an immutable class. The default value of mutable is “true”.

 

22) What is hash-collision in a HashTable? How is it handled in Java?

In HashTable, when two different keys have the same hash value, then it leads to hash-collision. A bucket of type linked list is used to hold the different keys of the same hash value

 

23) How do you create custom exception in java?

You need to extend Exception class to create custom exception. If you want to create Unchecked exception, then you need extend Runtime Exception.

 

24) Can we call run method directly to start a thread?

No, you cannot directly call run method to start a thread. First you need to call start method to create a new thread. If you call run method directly, it won’t create a new thread and it will be in same stack as main.

 

 25) What is System.gc()?

This method is used to invoke garbage collection for clean up unreachable object but it is not guaranteed that when you invoke System.gc() , garbage collection will definitely trigger.

 

Blog

Register For Online Demo


Can't read the image? click here to refresh