Posts

Showing posts with the label CoreJava

Polymarphism interview questions and answers in java

Polymorphism is one of the Oops concept and mostly used feature in java. The ability of an object to take more than one form is called Polymorphism. The most common use of polymorphism in OOPs occurs when a parent class reference is used to refer to a child class object.         It is impossible to know that the only possible way to access the object is through a reference variable. A reference variable can be of  only one type. Once declared, the type of the reference variable cannot be changed.         A reference variable can refer to any object of its declared type or any subtype of its declared type. A reference variable can be declared as a class or interface. Ex: Let's take a look into the below example 1 2 3 4 5 interface Vehicle {} class Mileage {} public class Car extends Mileage implements Vehicle {} see the implementation of the above example, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3

Object Oriented Programming in java

Object Oriented Program or Oops is a technique to create programs based on the real world object. In the Oops programming model programs are organized around objects and data rather than actions and logic. What is Oops?           An Object Oriented Programming organizes a program around its data, i.e., objects and a set of well defined interfaces to that data. An object-oriented programming can be characterized as data controlling access to code. Why Oops?           Object Oriented Programming enables programmers define not only the data, but also its associated behaviors that can be applied to the data. It also enables programmers to create relationship between one object and another. For example, Objects can inherit characteristics from other objects. To understand the importance of Oops first we need to understand the problem with Procedural / Structural programming practices. Problems with Procedure Oriented Programming?           Procedure Oriented Programming

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