Dependable Auto Transport at EZAutoShippers.com
Top 10 Interview Questions

Categories

Top 10 Interview Questions


Top 10 Interview Questions on Object Oriented Programming

Top 10 Interview Questions on Object Oriented Programming

1. What is an Object in OOPS?

An object is a software bundle of variables and related methods. Objects are related to real life scenario. Class is the general thing and object is the specialization of general thingObjects is instance of classes.

Declaration of an Object in OOPs

ClassName objectName=new ClassName();

E.g.: Person objPerson= new Person();

An object is characterized by concepts like:

• Attribute

• Behavior

• Identity

2. What is an Attribute in OOPs?

• Attributes define the characteristics of a class.

• The set of values of an attribute of a particular object is called its state.

• In Class Program attribute can be a string or it can be a integer

3. What is a Behavior in OOPS?

• Every object has behavior

• In C#, behaviors of objects are written in methods.

• If a behavior of an object needs to be performed, then the corresponding method is called.

4. What is an Identity in OOPS?

• Each time an object is created the object identity is been defined.

• This identity is usually created using an identifier which is derived from the type of item

5. What is Encapsulation in OOPS?

• Encapsulation is one of the fundamental principles of object-oriented programming.

• Encapsulation is a process of hiding all the internal details of an object from the outside world

• Encapsulation is the ability to hide its data and methods from outside the world and only expose data and methods that are required

• Encapsulation is a protective barrier that prevents the code and data being randomly accessed by other code or by outside the class

• Encapsulation gives us maintainability, flexibility and extensibility to our code.

• Encapsulation makes implementation inaccessible to other parts of the program and protect from whatever actions might be taken outside the function or class.

• Encapsulation provides a way to protect data from accidental corruption

• Encapsulation hides information within an object

• Encapsulation is the technique or process of making the fields in a class private and providing access to the fields using public methods

• Encapsulation gives you the ability to validate the values before the object user change or obtain the value

• Encapsulation allows us to create a "black box" and protects an objects internal state from corruption by its clients.

There are two ways to create a validation process.

1. Using Assessors and Mutators

2. Using properties

Benefits of Encapsulation

• In Encapsulation fields of a class can be read-only or can be write-only

• A class can have control over in its fields

• A class can change data type of its fields anytime but users of this class do not need to change any code

6. What is Inheritance in OOPS?

• Inheritance, together with encapsulation and polymorphism, is one of the three primary characteristics (concept) of object-oriented programming

• Inheritance enables you to create new classes that reuse, extend, and modify the behavior that is defined in other classes

• The Class whose methods and variables are defined is called super class or base class

• The Class that inherits methods and variables are defined is called sub class or derived class

• Sometimes base class known as generalized class and derived class known as specialized class

• Keyword to declare inheritance is ":" (colon) in visual c#

Benefits of using Inheritance

• Once a behavior (method) or property is defined in a super class(base class), that behavior or property is automatically inherited by all subclasses (derived class).

• Code reusability increased through inheritance

• Inheritance provide a clear model structure which is easy to understand without much complexity

• Using inheritance, classes become grouped together in a hierarchical tree structure

• Code are easy to manage and divided into parent and child classes

7. What is Polymorphism in OOPS?

• Polymorphism is one of the primary characteristics (concept) of object-oriented programming

• Poly means many and morph means form. Thus, polymorphism refers to being able to use many forms of a type without regard to the details

• Polymorphism is the characteristic of being able to assign a different meaning specifically, to allow an entity such as a variable, a function, or an object to have more than one form

• Polymorphism is the ability to process objects differently depending on their data types

• Polymorphism is the ability to redefine methods for derived classes.

Types of Polymorphism

• Compile time Polymorphism

• Run time Polymorphism

8. What is Compile Time Polymorphism in OOPS?

• Compile time Polymorphism also known as method overloading

• Method overloading means having two or more methods with the same name but with different signatures

9. What is Run Time Polymorphism in OOPS?

• Run time Polymorphism also known as method overriding

• Method overriding means having two or more methods with the same name , same signature but with different implementation

10. What is Access Modifier in OOPS?

Access modifiers determine the extent to which a variable or method can be accessed from another class or object

The following five accessibility levels can be specified using the access modifiers

• Private

• Protected

• Internal

• Protected internal

• Public

For More Details on Interview Questions and Answers Please Visit

http://www.questpond.com


I'm a simple programmer working on c sharp , .net , sql server , oracle , java , php , flex , SEO I also into training of programming languages

Article Source: ArticlesBase.com

Next page: Yahoo Consumer Reports


Top 10 Interview Questions News


Diller Beats Google With Top Web Stock: Riskless Return - Bloomberg


Bloomberg

Diller Beats Google With Top Web Stock: Riskless Return
Bloomberg
That model helps increase the number of questions posed through the toolbar -- and revenue via click-throughs. “We call them digital snacks,” Blatt said in the phone interview. “They're not change-the-world products, they're things that people like to ...

and more »

Read more...


10 hazards of buying individual stocks - MarketWatch


10 hazards of buying individual stocks
MarketWatch
But even the master's index-funds-only mantra recedes into a charming anachronism once his interview ends and the trading types reappear with their yelping about this or that particular stock. Oh, I know. It is good TV. It is sexy, exciting, fast.

Read more...


Top 10 Shahrukh Khan controversies - New York Daily News


The Hindu

Top 10 Shahrukh Khan controversies
New York Daily News
Here is a list of his top 10 controversies during his career. Stardom comes at a price and SRK can surely vouch for it. King Khan has become one of the most controversial actors in B-Town owing to either his celebrity status, religion or behavior.
Top 10 Shah Rukh Khan controversiesHindustan Times

all 1,267 news articles »

Read more...


Help! How do I sell my house? - Washington Post (blog)


Help! How do I sell my house?
Washington Post (blog)
By Olga Khazan In connection with our story on strategies for home-sellers, real estate broker Morgan Knull took reader questions on ways sellers can better position themselves to get a fair offer on their homes. An edited transcript follows.

Read more...


Weaver delivers Top 10 list on Letterman - MLB.com


Weaver delivers Top 10 list on Letterman
MLB.com
I got a chance to do a little interview before we did the Top 10 and stuff, he asked me some questions, and it was cool. It was fun. A lot of fun." Weaver was stationed in one of the Target Field broadcast booths for about a half-hour pregame, ...

and more »

Read more...


Washington Nationals "Attacked" Last Three Drafts In Preparation For Changes ... - Federal Baseball


Washington Nationals "Attacked" Last Three Drafts In Preparation For Changes ...
Federal Baseball
There were some questions about whether or not they'd be able to sign Stephen Strasburg ('09) and Bryce Harper ('10), but no mystery around who they'd make the top picks. Last year the Nationals had Anthony Rendon, widely considered the best available ...

Read more...


RI's big bet on Curt Schilling raises questions - BusinessWeek


Southeast Missourian

RI's big bet on Curt Schilling raises questions
BusinessWeek
Donald Carcieri and top economic development officials, it was an opportunity too good to miss. The state's Economic Development Corp. offered a $75 million loan guarantee to lure Curt Schilling's 38 Studios to Providence. Two years later, the company ...
Rhode Island's big bet on Curt Schilling raises a lot of questionsSoutheast Missourian

all 562 news articles »

Read more...


Permalink: Top 10 Interview Questions | Copyright © 2012 wesellcarinsurance.com All Rights Reserved