Categories
Core JAVA

Top 40 JAVA Programming Questions

JAVA Programming Questions How to add argument in java Program for Create an Array in JAVA Factorial Program in JAVA Write a Program to find out greatest between float number using Command line. Program for Local Variable in JAVA Constructor Program in JAVA Copy Constructor in JAVA PrimeFactor Program in JAVA Pyramid Program in JAVA […]

Categories
Core JAVA

Multithreading in Java

Thread is a light-weight process. The processing unit is known as a thread. When a process is divided into multiple parts and each part can be executed independently, then it is known as multi-threading or multi-tasking. Multithreading in java is very suitable for game and network applications. Multithreading Multithreading is a Java feature that allows […]

Categories
Core JAVA

HashSet and TreeSet in Java

HashSet and TreeSet both are present in java. util package.Both evaluate on the basis of object values, not on the basis of the index.Both cannot store any duplicate index. HashSet is faster than TreeSet and it should be the preferred choice if sorting of the element is not required. Difference:- HashSet store in random order […]

Categories
Core JAVA

ArrayList in Java with example

ArrayList in Java ArrayList is a part of the Collection framework and it is present in java. util package. It provides dynamic arrays in Java. The similarity between the array list and arrays is both are sequential. For searching and sorting ArrayList is faster than LinkedList. For insertion and deletion, LinkedList is faster than ArrayList […]

Categories
Core JAVA

Stack in Java

Stack Stack in Java, The evaluation of stack is always LIFO(last in first out) order. The operation on the stack always for the top of the stack. The stack is non-synchronous in nature. The duplicate element can be stored by using the stack data structure. Index of stack always starts with 1. Methods in stack:- […]

Categories
Core JAVA

Collection Framework in Java

Collection Framework In java collection framework is classes and interfaces which are generally used to implement data structure. The collection is a group of similar types of object and itself is a predefined interface present in java. util package. All the operation which are generally performed on a data structure such as searching, sorting, insertion, […]

Categories
Core JAVA

Exception Handling in Java

Exception Handling It is a situation in which the program terminates abnormally. In Java, an exception is divided into two categories:- If an exception occurs at the time of run time of compilation is known as a checked exception. If an exception occurs at the time of compile-time it is known as an unchecked exception. […]

Categories
Core JAVA

File in JAVA

File in JAVA The file is a container which stores data permanently Data can be stored in two different ways :-For a temporary period with RAM memory :-For permanently period with HDD Data store in variable array link list is temporary because all allocate memory from RAM Tor store data permanently programming language support two […]

Categories
Core JAVA

String,String Buffer and String Builder in JAVA

String, String Buffer and String Builder in JAVA:- String:- String is predefined final class present in the default package. As string is a final class it cannot be inherited. String is purely immutable(contents cannot be changed) in nature that contents of the string cannot be changed once it assigns. How string is immutable? PROGRAM:- class […]

Categories
Core JAVA

Array in JAVA

Array in JAVA:-    Array in Java is a collection of similar types of data store in sequential order. It is used to create a list Array is static in nature. Array size is known. Array cannot be shrinked. Types of array:- Array is two types:- single dimensional array multidimensional array Array construction:- Array construction possible […]

Categories
Core JAVA

Uses of Super keyword in java

Working with super keyword:- Super keyword in java which can be used to solve 3 different problems. Super always refers to parent class object. superkeyword in Java is a reference variable that is used to refer parent class objects Super keyword only can be placed within a non-static method or nonstatic block or constructor. Whenever […]

Categories
Core JAVA

Uses Of this keyword in java

Working with “this” keyword:- This keyword in java is a keyword which always refers to a current class object.T he difference between ‘new’ and ‘this’ is new is responsible to call a  constructor and create a new object. Whereas “this” is responsible to call the constructor without allocating memory. this keyword can be very useful in the handling of […]

Categories
Core JAVA

Upcasting and Downcasting in java

Upcasting and Downcasting:- (Upcasting and Downcasting ) Java support Run-time polymorphism with the help of method overriding. Method overriding only applicable when the signature (prototype, return type, name, argument) of the superclass is the same as the subclass method, then it is known as method overriding. Dynamic method dispatch allows Java to support overriding of methods […]

Categories
Core JAVA

Polymorphism in JAVA

Polymorphism in Java:- Polymorphism in Java is an object-oriented concept which is used to create different from a single resource. The polymorphism can be achieved by two different ways in java:- with the help of overloading that is known as compile time polymorphism. with the help of overriding, that is known as runtime polymorphism.   […]

Categories
Core JAVA

What is interface in JAVA ?

  Interface in JAVA:- An interface in Java is very similar to an abstract class. Both cannot be instantiated. It is similar to a class. It is a collection of abstract methods. The interface in java is a mechanism to achieve abstraction. Java Interface represents the IS-A relationship. The benefit of using interfaces is that they […]