-
Basic
- variables
- datatypes
- operators
-
Modifiers
-
Access modifiers
- The access modifiers in Java specifies the accessibility or scope of a field, method, constructor, or class. We can change the access level of fields, constructors, methods, and class by applying the access modifier on it.
-
Private
- Class only
- The access level of a private modifier is only within the class. It cannot be accessed from outside the class
-
Default
- Class + Package
- - If you do not specify any access level, it will be the default.
- The access level of a default modifier is only within the package. It cannot be accessed from outside the package.
-
Protected
- Class + Package + OutsidePackage
- - The access level of a protected modifier is within the package and outside the package through child class.
- If you do not make the child class, it cannot be accessed from outside the package.
-
Public
- Every where
- - The access level of a public modifier is everywhere.
- It can be accessed from within the class, outside the class, within the package and outside the package.
-
Non Access modifiers
- static
- abstract
- synchronized
- transient
- native
- volatile
-
Loops / Control statements
- while
- do-while
- for
- for each
- switch
-
File Handling
-
Usage
- taking Screenshot
- Reading text,csv,excel files
- String
- Packages
- JDBC
-
OOP
-
Learning Resources
- Subtopic 1
-
Object
- A dog is an object because it has states like color, name, breed, etc. as well as behaviors like wagging the tail, barking, eating, etc.
-
Class
- - Collection of objects is called class.
- A class can also be defined as a blueprint from which you can create an individual object. Class doesn't consume any space
-
Inheritance
- - When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism
-
Polymorphism
- - If one task is performed in different ways, it is known as polymorphism.
-
static/compile time
- - Overloading is related to compile-time (or static) polymorphism.
- Overloading allows different methods to have the same name, but different signatures where the signature can differ by the number of input parameters or type of input parameters or both.
- If the exact prototype does not match with arguments, Type conversion to next higher family(suppose if there is no long data type available for an int data type, then it will search for the float data type).
-
dynamic/run time
- - Overriding is a feature that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its super-classes or parent classes.
-When a method in a subclass has the same name, same parameters or signature, and same return type(or sub-type) as a method in its super-class, then the method in the subclass is said to override the method in the super-class
- If a Parent type reference refers to a Parent object, then Parent's method is called
- If a Parent type reference refers to a Child object, then Child's method is called. This is called RUN TIME POLYMORPHISM.
- a protected instance method in the super-class can be made public, but not private, in the subclass. Doing so, will generate compile-time error.
- Final methods can not be overridden
- Static methods can not be overridden
- Private methods can not be overridden
- We can not override constructor as parent and child class can never have constructor with same name(Constructor name must always be same as Class name).
-
Abstraction
- - Hiding internal details and showing functionality is known as abstraction
- In Java, we use abstract class and interface to achieve abstraction.
-
Encapsulation
- - Binding (or wrapping) code and data together into a single unit are known as encapsulation
-
- Interface
-
Data -hiding concepts
- access modifiers
-
Advanced
- Exception Handling
- Threading
-
Collections
-
usage
- to store more than one web elements ,window / frame handling so on
- Enum
- Reflection
- Generics
-
Interview questions
- Can we overload the main method?
- Like other static methods, we can overload main() in Java
- A Java Constructor returns a value but, what?
- Can we create a program without main method?
- What are the six ways to use this keyword?
- Why is multiple inheritance not supported in Java?
- Can we override the static method?
- What are the three usages of Java super keyword?
- What is the usage of a blank final variable?
- What is runtime polymorphism or dynamic method dispatch?
- What is the difference between static and dynamic binding?
- What is the purpose of a private constructor?
- What if the exact prototype does not match with arguments in method overloading?
- Type conversion to next higher family(suppose if there is no long data type available for an int data type, then it will search for the float data type).
- Can we overload methods on return type?
- No method can only be overloaded based on input params not return types.
- Can we overload static methods?
- YES
- Can we overload methods that differ only by static keyword?
- No
- Exercises
-
Categories
- Java EE(Enterprise Edition)
- Java ME(Mobile Edition)
- Java SE(Standard Edition)