Posts

Showing posts with the label java basics

Collection Framework interview questions and answers in java

In this current page we will come to know about collection framework interview questions with answers. It may possible to ask questions out of these questions. But, these questions and answers will definitely helps you to answer easily collection framework questions. If any of you are facing more then these interview questions please share with me through "Contact me here" gadget or drop me an email to " admin@javatbrains.com ".     1. What is a Collection Framework? A: A Collection framework is a class library to handle groups of objects. Collection framework is implemented in java.util package. 2. Does a collection object store copies of other objects or their references? A: A Collection object stores references of other objects. 3. What are the major interfaces in java.util package? A: List: A List represents a group of elements arranged just  like an array. A List will grow dynamically when the elements are stored into it. List stores a group of elemen

Inheritance interview questions and answers in java

Image
Inheritance is one of the oops concept. If any interview you have attended on java developer there must and should be inheritance related questions you will face it. So, here are few of the inheritance questions and answers. If any one of you people are facing more than these interview questions, share with me through "contact me here" gadget or drop me an email to " subbareddynallamachu@gmail.com ". Q1: What is Inheritance in java? A: Deriving new class from existing classes such that the new classes acquire all the features of existing classes is called inheritance. Q2: Why super class members are available in sub class? A: Because, Sub class object contains a copy of Super class object. Q3: What is the advantages of inheritance? A: Inheritance main use is, a programmer reuses the super class code without rewriting it, in creation of sub classes. So, developing classes becomes very easy. Hence, the programmers productivity is increased. Q4: What is the us

Methods interview questions and answers in java

A method represents group of statements that performs a task. Here, Task represents a calculation or processing of data or generating a report etc. This page also contains the information of the methods related interview questions and answers in java. If any one are facing more than these interview questions please share with me through "Contact me Here" gadget or drop me an email to " subbareddynallamachu@gmail.com ". Q1: How many types of methods are there in java? A: In java mainly two types of methods are there. That are,                 1. Instance methods                 2. Static methods                 3. Factory methods Q2: What are instance method? A: Instance methods are methods which act on the instance variable of the class. To call the instance methods. We should use the form: objectname.methodname(). Q3: What are static methods? A: Static methods are methods which do not act up on the instance variable of a class. static methods are declare

Threads interview questions and answers in java

In this page we will come to know most of the threads interview questions and answers. If any one has faced any of the other questions which is not mentioned in the current page. Please share with me through "Contact me here" gadget which is present in end of the page or drop me an email to " admin@javatbrains.com ".   Q1: How many ways you can create a Thread? A: Mainly two ways we can create Thread class. Extending Thread class implementing Runnable Interface Q2: Can you e xplain about these two ways to create a Thread? A: The first method of creating a thread class is to simply extend from the Thread class. This should be done if the class does not ever need to be extended from another class.               import java.lang.*;               public class Count extends Thread{                      public void run(){                             .....                      }               }         The above example creates anew class Count that ext

Overloading and Overriding with Polymorphism in java

Polymorphism is a Greek word. Poly means many moprhism means form. In java one form is using for multiple uses is called polymorphism. It is mainly two types. That are called             •    Compile time polymorpshism/static polymorpshism             •   Runtime polymorphism/dynamic polymorphism           Static polymorphism is called the overloading and dynamic polymorphism is called overriding in java.  At the time of method overloading java compiler will understand which  method is calling, is called static polymorphism. At the time of compilation java compiler will not identifies which method is calling exactly, that will understand JVM at the time of runtime is called Overriding in java.             Overloading again two types, that are method overloading and constructor overloading. But, constructors we can't override in java, because of ambiguity. Method Overloading: Which of two or more methods declared with the same method name with different signature i