Skip to main content

Posts

Showing posts with the label Java Interview Questions

Java Frequently Asked Questions in Interviews for Freshers

What are Encapsulation, Inheritance and Polymorphism?- Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Inheritance is the process by which one object acquires the properties of another object. Polymorphism is the feature that allows one interface to be used for general class actions. What is OOPs? - 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 program can be characterized as data controlling access to code. What are Class, Constructor and Primitive data types? - Class is a template for multiple objects with similar features and it is a blue print for objects. It defines a type of object according to the data the object can hold and the operations the object can perform. Constructor is a special kind of method that determines how an object is initialized when created. Primitive data ty...

Core Java Common Interview Questions and Answers

What is the difference between procedural and object-oriented programs? - a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination of data and code. b) In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in turn assures the security of the code. What is the difference between Assignment and Initialization? - Assignment can be done as many times as desired whereas initialization can be done only once. What is the difference between constructor and method? - Constructor will be automatically invoked when an object is created whereas method has to be called explicitly. What is the difference between an argument and a parameter? - While defining method, variables passed in the method are called parameters. While using those methods, values passed to those variable...