what is regular expression in java?
A regular expression is a pattern of characters that describe a set of strings. you
can use the java.util.regex package to find, display, or modify some or all of the
occurences of a pattern in an input sequence.
The simplest form of a regular expression is a literal string, such as "Java" or
"Programming". Regular expression matching also allows you to test whether a string
fits into a specific syntactic form, such as an email address
what is abstract method?
A class which is declared with the abstract keyword is known as an abstract class
in java. it can have abstract and non-abstract methods(method with the body)
Abstraction is a process of hiding the implementaion details and showing only
functionality to the user.
ways to achieve abstraction: two ways to achieve abstraction in java. 1.Abstract
class (0 to 100%) 2.interface (100%)
Abstract class
A class which is declared as abstract is known as an abstract class. it can have
abstract and non-abstract methods. it needs to be extended and its method
implemented. it cannot be instantiated.
*An abstract class must be declared with an abstract keyword.
*It can have abstract and non-abstract methods.
*It cannot be instantiated.
*It can have constructors and static methods also
*It can have final methods which will force the subclass not to change the body of
the method.
Exception Hierarchy
The java.lang.Throwable class is the root class of java exception hierarchy
inherited by two subclassess: Exception and Error.
Throwable
Exception Error
-IOException -StackOverflowError
-SQLException -VirtualMachineError
-ClassNotFoundException -OutOfMemoryError
-RuntimeException
*ArithmeticException
*NullPointerException
*NumberFormatException
*IndexOutofBoundException
#ArrayindexOutOfBoundsException
#StringindexOutOfBoundsException
Types of java exceptions
checked and unchecked exception
checked exception : the classes that directly inherit the Throwable class expect
RuntimeException and Error are known as checked exceptions. for Example,
IOException, SQLException, etc. checked exception are checked at compile-time.
unchecked exception : the classes the inherit the RunTimeException are known as
unchecked exceptions. for example, ArithmeticException, NullPointerException,
ArrayIndexOutOfBoundsException, etc. Unchecked exceptions are not checked at
compile-time, but they are checked at runtime.
mutlithread - multithreading in java is a process of executing multiple threads
simultaneously.
A thread is a lightweight sub-process, the smallest unit of processing.
multiprocessing and multithreading both are used to achieve multitasking.
thread -> runnable interface -> override run() method then start() it
new - active -blocked/waiting - timed waiting - terminated
static is jvm invoke
access modifier
private - within the class
default - within the package
protected - within the package and outside of package through child class
public - within the package and outside the package and class also
main method static point of java
oops concepts
abstraction
is a process of hidding the implementation detials and showing only functionality
to the user.
encapsulation
is a process of wrapping code and data together into a single unit.
this keyword - it refers to current object and current class
super keyword - is reference variable which is used to refer parent class object
final keyword - final variable class method
garbage collection - it will collect the unused memory - it fill free up the memory
which was occupied the unused memory.
set and list map
cash mechanisum - storage mechanisum to running program to connected database. it
fetch the data and give output
autowired - lossely coupling and dependency injection
multithread purpose - system
foregin key - linkage b/w two table.
joins - sql
limit and offset
limit is fetch 1st