Java Code Snippets

What is the difference between procedural and object-oriented programs?-

Java code

Written by abnotaLok Sunday, 08 April 2012 18:05

  1. 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?-

Java code

Written by abnotaLok Sunday, 08 April 2012 18:05

Assignment can be done as many times as desired whereas initialization can be done only once.

What is OOPs?

Java code

Written by abnotaLok Sunday, 08 April 2012 18:05

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?

Java code

Written by abnotaLok Sunday, 08 April 2012 18:05

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 types are 8 types and they are: byte, short, int, long, float, double, boolean, char.

What is an Object and how do you allocate memory to it?

Java code

Written by abnotaLok Sunday, 08 April 2012 18:05

Object is an instance of a class and it is a software unit that combines a structured set of data with a set of operations for inspecting and manipulating that data. When an object is created using new operator, memory is allocated to it

 

Page 1 of 2

«StartPrev12NextEnd»

Login Form (Can use your Gmail Acct)

Latest Comments

Copyright © 2017 Interview Questions, Tutorials, Certification Questions. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.