Course
Java
138 lessons254 min total
-
What is Java programming language
Introduction to Java programming language In 1995, James Gosling founded Sun Microsystems Inc, which was later acquired by…
-
Features of JAVA programing language
There were numerous characteristics that contributed to the final form of this outstanding language. The major features of…
-
Setting CLASSPATH in Java
In Java, you can set the CLASSPATH variable. CLASSPATH: Application ClassLoader uses CLASSPATH as an environment variable to…
-
Byte Code in Java
Byte Code: The Java byte code is a machine instruction for a Java processor chip called Java Virtual…
-
Java Virtual Machine(JVM)
Programs written in Java are compiled into Java Byte code, which is then interpreted by a special Java…
-
JDK vs JRE vs JVM
Let us now compare Java Virtual Machine, JRE, and JDK. The following are the key distinctions between JDK,…
-
Simple Hello World Program
Requirement for Java Hello World Program: Install the JDK if you don’t have installed it, download the JDK and install…
-
Token and keywords
Token The smallest individual unit in a program is known as a token. In fact, every unit that…
-
Identifiers
Identifiers are fundamental building blocks of a program and are used as the general terminology for the names…
-
Literals in Java
Literals(often referred to as constants) are data items that are fixed data values. Java allows several kinds of…
-
Escape Sequence
Java allows us to have certain non-graphic characters in character constants. (non-graphic characters are those which cannot be…
-
Data Types in Java
Data types are means to identify the type of data and associated operations of handling it. Java, like…
-
Variables in Java
Variables represent named storage locations, whose values can be manipulated during the program run. For instance, to store…
-
Constants in Java
In programming, a constant is an immutable entity. To put it another way, the value cannot be altered.…
-
Operators in JAVA
The operators in Java represent the operations, i.e, operators perform operations on the operands. Let us discuss the…
-
Operator Precedence & Associativity
Operator precedence determines the order in which the operators in an expression are evaluated. Associativity rules determine the…
-
Type casting in Java
In Java, type casting is a method or process for manually and automatically converting one data type into…
-
Selection Statement
The selection statement allows choosing the set of instructions for execution depending upon an expression’s truth value. Java…
-
if-else ladder & nested if block
if-else ladder: The if-else-if ladder statement is used to test multiple conditions in Java. It’s used to test…
-
switch Statement
Java provides a multiple-branch selection statement known as a switch. This selection statement successively tests the value of…
-
The switch vs if-else
The switch and if-else both are selection statements, and they both let you select an alternative out of…
-
Iteration Statements(Loops)
The iteration statements allow a set of instructions to be performed repeatedly until a certain condition is fulfilled.…
-
More about loops
Multiple initialization and update Expression: A for loop may contain multiple initialization and/or multiple update expression. Optional Expression:…
-
Jump Statements
The jump statements unconditionally transfer program control within a function. Java has three statements that perform an unconditional…
-
Java Arrays
An array is a collection of variables of the same type that are referenced by a common name.…
-
Java object creation methods
Everything revolves around the object in Java, which is an object-oriented language. An object represents a class’s runtime…
-
Command Line Argument in Java
The java command-line argument is a parameter that is passed to the java program when it is run.…
-
OOPs in Java
What is OOPs? Object-Oriented Programming is a methodology or paradigm for designing a program using classes and objects. Many…
-
Methods in Java
A method is a block of code, a group of statements, or a set of code that performs…
-
Constructor in Java
Java constructors or constructors in Java are terminologies used to construct something in our programs. A constructor in…
-
More about Constructors
Let us take a look at various other constructors in Java. Copy constructor: A copy constructor is a type…
-
Access Modifiers in Java
Modifiers in Java are divided into two categories: access modifiers and non-access modifiers. The accessibility or scope of…
-
Non-access modifiers
Non-access modifiers provide the JVM with information about a class, method, or variable’s characteristics. In Java, there are…
-
Inheritance in Java
In Java, inheritance is a mechanism by which one object inherits all of its parent’s properties and behaviors.…
-
Association, Composition & Aggregation in Java
Association: Association is a relation between two separate classes which establishes through their Objects. One-to-one, one-to-many, many-to-one, and…
-
Method Overloading
Method Overloading in Java: Method Overloading occurs when a class has multiple methods with the same name but…
-
Method Overriding in Java
In Java, method overriding occurs when a subclass (child class) has the same method as the parent class.…
-
Runtime Polymorphism
Polymorphism: Polymorphism is a Java concept that allows us to perform a single action in multiple ways. Polymorphism…
-
Difference between method overloading and method overriding
In Java, there are numerous distinctions between method overloading and method overriding. The following is a list of…
-
this keyword in Java
this is a Java keyword that refers to the current object of a class. Uses of this keyword:…
-
Garbage Collection in Java
Garbage collection is the method through which Java programs maintain their memory automatically. working: Java programs are compiled…
-
Static keyword in Java
In Java, the static keyword is mostly used to control memory. It is also used to share a…
-
Final keyword in Java
In Java, the final keyword is used to restrict the user. The final keyword in Java can be…
-
instanceof Operator in Java
The instanceof operator is used to determine whether or not a reference variable contains a specific type of…
-
Packages in Java
In Java, a package is a container for a collection of classes, sub-packages, and interfaces. The package keyword is used…
-
Sub packages in Java
The subpackage is a package within a package. It should be developed to further categorize the package. Sub…
-
Abstract Class & Method in Java
In Java, an abstract class is specified with the abstract keyword. Both abstract and non-abstract methods can be…
-
Interface in Java
In Java, an interface is a blueprint for a class. It has abstract methods and static constants. In…
-
Interface vs Abstract class
As we all know, abstraction refers to hiding the internal implementation of a feature and only giving the…
-
Nested Class in Java
It is possible to define a class within another class in Java, and these classes are referred to…
-
Regular class vs static nested class
Comparison between a normal or regular class and a static nested class. S.NO Normal/Regular inner class Static nested…
-
Abstract class vs Concrete class
Following are the important differences between an abstract class and a concrete class. Sr. No. Key Abstract Class…
-
Strings in Java
Strings are Objects in Java that are internally backed by a char array. They are immutable because arrays…
-
String class methods in Java
Many useful methods for performing operations on a sequence of char values are available in the java.lang.String class.…
-
Some examples of string class methods
The methods listed below are some of the most frequently used String class methods in Java. charAt() method:…
-
Java StringBuffer class
StringBuffer is a String peer class that provides a lot of the same functionality as strings. StringBuffer represents…
-
StringBuilder class in Java
The Java class StringBuilder represents a mutable string of characters. The StringBuilder class offers a substitute for the…
-
StringTokenizer in Java
A string can be divided into tokens using Java’s StringTokenizer class. Internally, a StringTokenizer object keeps track of where it is in the string that has to be tokenized. Some procedures move this place ahead of the currently processed characters. By extracting a substring from the string that was used to generate the StringTokenizer object, a token is returned. It offers the initial stage of the parsing procedure, often known as the lexer or scanner. The String Tokenizer class enables applications to tokenize strings. The Enumeration interface is implemented by it. Data parsing is done using this class. We must specify an input string and a string with delimiters to use the String Tokenizer class The characters that divide tokens are known as delimiters. The delimiter string’s characters are all accepted as delimiters.…
-
Exception Handling in Java
One of the efficient ways to deal with runtime failures in Java is through exception handling, which helps…
-
try-catch block in Java
Java has two keywords for managing exceptions: try-catch block. Java try block : To contain code that might…
-
Java Multi-catch block
One or more catch blocks may come after a try block. A distinct exception handler must be present…
-
Nested try block & try with Resource Statement
Nested try block in Java: Java allows the use of try blocks inside of other try blocks. The…
-
throw, throws & finally
The Java keywords for managing exceptions include throw, throws, and finally. throw keyword: To throw an exception explicitly…
-
Java custom( user-defined) exception
Because our own exceptions are derived classes of Exception, Java allows us to create them. A custom exception…
-
Exception Handling with Method Overriding in Java
Exception Handling with Method Overriding: Ambiguity arises when method overriding and exception handling are combined. Which definition should…
-
Chained Exceptions
What are Chained Exceptions? One exception can be related to another using chained exceptions. We can use the…
-
Multithreading in Java
Java’s multithreading feature enables the concurrent execution of two or more program components for maximum CPU efficiency. A…
-
The life cycle of a Thread
In Java, a thread can be in any of the following states at any given time. A thread…
-
Java Thread Class
The java.lang.Thread class is a thread of execution in a program. The Java Virtual Machine enables an application…
-
Creating a Thread in Java
A thread can be created in one of two ways: By extending the Thread class By implementing Runnable…
-
Java join() method
join() method: The join() method of the Java.lang.Thread class enables one thread to wait until another thread has…
-
Thread.sleep() method in Java
Thread.sleep() method in Java: The two variations of the sleep() method are available from the Java Thread class.…
-
Naming a Thread in Java
The Thread class offers ways to modify and retrieve a thread’s name. Each thread by default has a…
-
Java Thread Priority
What is Thread Priority? The concept of priorities in threads states that each thread has a priority. In…
-
Daemon thread in Java
A daemon thread in Java is a background thread with low priority that runs operations like garbage collection.…
-
Synchronization in Java
What is Synchronization, and why is it used? Multiple threads trying to access the same resources in a…
-
Inter-thread Communication in Java
What is Inter-thread Communication? Java has a mechanism called inter-thread communication that allows another thread to enter (or…
-
Java.lang.ThreadGroup- class in Java
A group of threads is created by ThreadGroup class. It provides a practical method for controlling thread groups…
-
Enums in Java
What are Enums in Java? In computer languages, enumerations are used to express a collection of named constants.…
-
Autoboxing and Unboxing in Java
Primitive data types are handled differently in Java, which led to the development of wrapper classes, which include…
-
Input-output Stream in Java
With its I/O package, Java includes a variety of Streams that make it easier for the user to…
-
Serialization and Deserialization in Java
An object’s state can be transformed into a byte stream through a process known as serialization. Deserialization is…
-
Java Networking
What is Java Networking? Connecting two or more computing devices so that we can share resources is the…
-
Generics in Java
Generics are types that have parameters. The goal is to make it possible for methods, classes, and interfaces…
-
Collections in Java
What is a collection in Java? Java’s Collection framework offers an architecture for storing and managing a collection…
-
Interfaces of Java Collection framework
Numerous Interfaces in the Collections framework define the fundamental characteristics of distinct collection classes. Collection Interface: The interface…
-
Java.util.Collections Class
The Java Collections Framework includes the Collections class in the Java.util.Collections package. The static methods that work with collections…
-
Java Iterator for Collection Access
You will frequently wish to repeat the collection’s pieces. You might want to show each element, for instance.…
-
Java ArrayList in Collection Framework
The java.util package contains the collection foundation component ArrayList. In Java, it offers us dynamic arrays. Although it…
-
Java LinkedList in Collection Framework
The Collection framework is found in java.util package includes Linked List. This class is an implementation of the…
-
Java TreeSet class
TreeSet is a widespread Java implementation of the SortedSet interface that employs a Tree for storage. Whether an…
-
Map Interface in Java Collection Framework
Java includes a map interface. A mapping between a key and a value is represented by the util…
-
HashSet class in Java Collection Framework
The Java HashSet class is used to create a collection that stores data in a hash table. It…
-
LinkedHashSet class in Java Collection Framework
The LinkedHashSet class is an ordered HashSet with a doubly-linked List across all entries. This class is used…
-
HashMap class in Java Collection Framework
Since Java 1.2, HashMap<K, V> class has been part of the Java collection. This class can be found…
-
Treemap class in Java Collection Framework
Along with the AbstractMap Class, the TreeMap class in Java is used to implement the Map interface and…
-
Hashtable class in Java Collection Framework
The Hashtable class creates a hash table by mapping keys to values. As a key or value, any…
-
Collections Class in Java
The Collections class belongs to the Java Collections Framework. The package java.util.Collections is the package containing the Collections…
-
Comparable Interface in Java
The Comparable interface is used to compare an object of the same class with an instance of that class; it also enables data ordering for user-defined class objects. The class has to implement the java.lang.Comparable interface to compare its instance, it provides the compareTo() method, which accepts an object of that class as an argument. Its sorting…
-
Comparator Interface in Java Collection Framework
To sort the objects of user-defined classes, a comparator interface is utilized. A comparator object can compare two…
-
Legacy Classes in Java
What are the Legacy Classes in Java? Before Java 1.2, there were multiple classes and interfaces to hold…
-
Java Applet
A Java Applet is a sort of software that is embedded in a webpage to generate dynamic content.…
-
Graphics in Applet
java.awt.Graphics class in Applet has methods for working with graphics. Methods of the Graphics class: Method Description public…
-
JApplet class in Applet
JApplet is a public java swing class created for developers often developed in Java. JApplet is usually written…
-
Event Handling in Java
An event is defined as the act of changing the state of an item or behavior. A button…
-
AWT (Abstract Window Toolkit) in Java- I
Graphical User Interface (GUI) programming is supported by the Abstract Window Toolkit (AWT). Java AWT components are platform-dependent,…
-
AWT (Abstract Window Toolkit) in Java- II
Java AWT TextArea: A TextArea class’s object is a multiline zone that displays text. It allows you to…
-
Swing Class in Java
Swing is a Java Foundation Classes [JFC] framework and an Abstract Window Toolkit [AWT] extension. Swing has much-improved…
-
Java Swing Components and Containers -I
Containers are essential SWING GUI components. A container is a space in which a component can be placed.…
-
Java Swing Components and Containers -II
Java JTable: The JTable class is used to display tabular data. It is made up of rows and…
-
Wrapper Class in Java
A Wrapper class is one whose object contains or wraps primitive data types. When we create an object…
-
Byte Class in Java
The Byte class creates an object out of a primitive type byte value. An object of type Byte…
-
Short class in Java
The Short class is a wrapper class for the primitive type short. It contains several methods for dealing…
-
Float class in Java
The Float class is a wrapper class for the primitive type float. It contains several methods for dealing…
-
Double class in Java
The Double class is a wrapper class for the primitive type double. It contains several methods for dealing…
-
Boolean class in Java
In java.lang package, there is a wrapper class Boolean. A value of the primitive type boolean is wrapped…
-
Character class in Java
In java.lang package, Java includes a wrapper class called Character. A single field of type char is contained…
-
Reflection in Java
Reflection is a runtime API for inspecting and modifying the behavior of methods, classes, and interfaces. The classes…
-
Java.lang.Class class in Java
Java includes a class called Class in the java.lang package. In a running Java application, instances of the…
-
Remote Method Invocation(RMI) in Java
Remote Method Invocation (RMI) is an API that allows an object to call a method on another object…
-
What is JDBC?
JDBC (Java Database Connectivity) is the Java API for connecting to a database, issuing queries and commands, and…
-
JDBC API(java.sql Package)
The Java Database Connectivity (JDBC) API allows Java programmers to access data from any database. You can use…
-
Java Database Connectivity
To connect any Java application to a database using JDBC, follow these five steps. These are the steps…
-
Java connect to MySQL database with JDBC
Follow the steps below to connect a Java application to a MySQL database using the JDBC Driver. Download…
-
Using the Thin Driver to Connect to an Oracle Database
Follow the steps below to connect a Java application to an Oracle database using Thin Driver. Download Oracle…
-
Java connectivity to MongoDB database
MongoDB is a no-SQL database that is document-oriented. MongoDB, which was first released in 2009, successfully replaced rows…
-
Inner class in Java
In Java, an inner class is a class that is declared within another class or interface. To summarize,…
-
File class in Java
The File class represents a file or directory path name in Java. Because file and directory names differ between platforms, naming them with a simple string is insufficient. The File class is used to create files and directories, search for files, delete files, and so on. Fields of…
-
Abstract List in Java
This class provides a skeletal implementation of the List interface in order to reduce the effort required to…
-
AbstractSequential List in Java
The Java Collection Framework includes the AbstractSequential List class, which implements the Collection interface, and the AbstractCollection class.…
-
CopyOnWriteArrayList class
The CopyOnWriteArrayList class, which implements the List interface, is introduced in JDK 1.5. It is an enhanced version…
-
AbstractSet in Java
AbstractSet is a Java Collection Framework class that implements the Collection interface and extends the AbstractCollection class. It…
-
EnumSet in Java
What is EnumSet in Java? The EnumSet is a specialized implementation of the Set interface designed for use…
-
IdentityHashMap class in Java
The HashMap class is similar to the IdentityHashMap class. The IdentityHashMap implements the Map interface using Hashtable, and…
-
SortedMap Interface in Java
SortedMap is a collection framework interface. It guarantees that the entries are kept in ascending key order. This…
-
Queue Interface in Java
The Queue interface extends the Collection interface and is present in java.util package is used to hold the…
-
Deque Interface in Java
The Deque interface in java.util package is a queue interface subtype. A linear collection with the ability to…
-
Layout Managers in Java
Layout Managers are used to arrange components in a specific order. The Java Layout Managers allow us to…