Java
Java
List :
ArrayList :
LinkedList :
Vector :
- Synchronized
- vector is a legacy class
- vector is slow because it is synchronized
- A vector can use the iterator or enumeration interface to traverse the elements
HashSet :
LinkedHashSet :
TreeSet :
HashMap :
Hashtable :
Stack :
Queue :
LinkedHashMap :
TreeMap :
Interface :
- It is a blueprint of a class
- It has static final and abstract methods
- is a mechanism to achieve abstraction
- only abstract methods present
- also represents the IS-A relationship
- used to achieve loose coupling
Abstraction :
Encapsulation :
- Binding or wrapping the code and data together into a single unit it is called
encapsulation
- The main purpose of encapsulation is to provide the security
- To achieve encapsulation declare the variables as private and methods as public
of a class
- The main objective of encapsulation is data hiding or data security
Inheritance :
Polymorphism :
Strings :
- Errors are problems that mainly occure due to the lack of system resources
- It cannot be caught or handled
- It occurs at runtime
- These are mainly unchecked
- Ex : OutOfMemoryError
StackOverFlowError
VirtualMachineError
Exception :
- It is an event that occurs during the execution of the program and interrupts the
Throw :
Throws :
Super Keyword :
This keyword :
- this is a keyword
- this is a reference variable that refers to current class object instance members
- this keyword we can to differentiate between local and global variables
- we can use this keyword inside a instance method and inside a constructor only
- we cannot use this keyword inside a static method or static block
Static Keyword :
Volatile Keyword :
Transient Keyword :
- The transient keyword can be used with the data members of a class in order to
avoid their serialization.
Hibernate :
Hibernate methods :
- save
- delete
- update
- load
- get
Session :
Spring :
- Spring is a framework using which we can develop web application and web services
both.
- Before Spring Boot, Spring developers would develop this application using XML
based configuration.
Spring Boot :
Spring Annotations :
- Component
- Autowired
- Controller
- Service
- Repository
- RequestParam
SpringBoot Annotations
- SpringBootApplication
- RequestMapping
- GetMapping
- PostMapping
- PutMapping
- DeleteMapping
- RestController
- Value
Iterator :
-An Iterator is an object that can be used to loop through collections, like
ArrayList and HashSet.
-It is called an "iterator" because "iterating" is the technical term for looping.
-To use an Iterator, you must import it from the java.util package.
Wrapper Classes :
-Wrapper classes provide a way to use primitive data types (int, boolean, etc..) as
objects.
Threads :
Multithreading :
- Multithreading is a Java feature that allows concurrent execution of two or more
parts of a program for maximum utilization of CPU.
- Each part of such program is called a thread.
- So, threads are light-weight processes within a process.
- Threads can be created by using two mechanisms :
* Extending the Thread class
* Implementing the Runnable Interface
Occurance Of letters :
import java.io.*;
import java.util.*;
class HelloWorld {
public static void main(String[] args) {