Exception in Java
Introduction: Exception: An exception is an unwanted or unexpected event, that disturbs the normal flow of the program i.e at run time is called an exception. It is highly recommended to handle exceptions so that the program terminates normally. The main objective of exception handling is graceful (normal) termination of the program. What …. Read More
Multithreading in Java
Introduction In java, Multithreading means multiple threads executing simultaneously in a process is called Multithreading. By definition, multitasking is when multiple processes share common processing resources such as a CPU. What is thread? A thread is a sub-process of a process. When a big process is divided into multiple small processes, then that …. Read More
Inter-thread communication in Java
What is Inter-thread communication? When two threads will communicate with each other is called Inter-thread communication. Two threads will communicate with each other by using wait(), notify(), notifyAll() methods. wait(), notify(), notifyAll() methods are available in Object class, but not in threads class. Because the thread is required to call these methods on any shared …. Read More
Synchronization in Java
Introduction Synchronization in Java is an important concept since Java is a multi-threaded language, It has the capability to control the access of multiple threads to any shared resource. Synchronization in Java is possible by using Java keywords “synchronized”. It is a better option when requirement is only one thread to access the shared resource …. Read More
String StringBuffer and StringBuilder.
We are going to discuss the difference between String and StringBuffer and StringBuilder. 1.Differences between String and StringBuffer. String: Once we create a string object we can’t perform any changes in the existing object. If we try to perform any changes with those changes a new object will be created. This non-changeable is nothing but …. Read More
String in Java
Introduction String is one of the most widely used classes in java programming by developers. Strings are immutable, so StringBuffer and StringBuilder classes come to make the string mutable (manipulations) easy way. String In Java, a string is an object which represents a sequence of characters. String is immutable, which means it can not …. Read More
Java Interview Question and Answer.
In this post, we are going to discuss some important Java Interview Questions and Answers. Difference between final, finally, finalize.? We’re going to take an overview of final, finally and finalize Java keywords. Final Final is a modifier applicable for classes, methods, and variables. If a class declared as a final then we …. Read More
Access Modifiers in Java.
The access modifiers in Java helps to restrict the scope of a class, constructor, variable, method, or data member. There are four types of access modifiers in java. Default Private Protected Public 1.Default access modifier When we don’t use any access modifier for a class, method, or data member, it is …. Read More
Object Oriented Programming (OOPs) Concept in Java.
Introduction Object-Oriented Programming (OOPs) is the concept of objects based programming, that contains data(fields) and its behavior (method), in a single location(object). Using object-oriented programming is to increase the flexibility and maintainability of programs. Truly object-oriented programming language is represented everything as an object, Main aims of Object-oriented programming to implement real-world entities like inheritance, …. Read More
Encapsulation in Java with Examples
Introduction Encapsulation is an OOP concept. It is a process of wrapping the data (variables) and code together into a single unit. It is a concept of hiding data in a class, from other classes using data hiding. That’s why it is also known as data hiding. What is Encapsulation? It is …. Read More