Showing posts from May, 2013
Examine the following section of code:
int area; String name; How many objects have been created?
A.   None—there is one object reference variable, but no objects yet. B.    One—there is one object reference variable so there must be one object. C.   Two—one for each variable. D.   Two—one for each type. 
Examine the following declarations:
int area;
String name;
Which of the following is true?
A.   area is a primitive variable, and name is a reference variable. B.   area is a reference variable, and name is a primitive variable. C.    both are primitive variables D.    both are reference variables 
Ans IS: A
A programmer is walking along a beach and finds a lamp. He rubs the lamp, and a genie appears.   I am the most powerful genie in the world. I can grant you any wish, but only one wish.

The programmer pulls out a map, points to it and says, I want peace in the Middle East.

The genie responds,  Gee, I don’t know. Those people have been fighting for millennia. I can do just about anything, but this is likely beyond my limits.

The programmer then says,  Well, I am a programmer, and my programs have lots of users. Please make all my users satisfied with my software and let them ask for sensible changes.

At which point the genie responds,  Um, let me see that map again.
A guy was crossing a road one day when a frog called out to him and said, "If you kiss me, I'll turn into a beautiful princess." He bent over, picked up the frog and put it in his pocket.

The frog spoke up again and said, "If you kiss me and turn me back into a beautiful princess, I will stay with you for a week." The guy took the frog out of his pocket, smiled at it and returned it to his pocket.

The frog then cried out, "If you kiss me and turn me back into a princess, I'll stay with you and do anything you want." Again the guy took the frog out, smiled at it and put it back into his pocket.

Finally the frog asked, "What is the matter? I've told you I'm a beautiful princess, that I'll stay with you for a week and do anything you want. Why won't you kiss me?" The guy said, "Listen, I'm a software engineer. I don't have time for a girlfriend, but a talking frog is cool." :P:P

What is the difference between abstraction and encapsulation?

Abstraction focuses on the outside view of an object (i.e. the interface) Encapsulation (information hiding) prevents clients from seeing it’s inside view, where the behavior of the abstraction is implemented.
Abstraction solves the problem in the design side while Encapsulation is the Implementation.
Encapsulation is the deliverable s of Abstraction. Encapsulation barely talks about grouping up your abstraction to suit the developer needs.

What is Abstraction?

Abstraction refers to the act of representing essential features without including the background details or explanations.

What are the principle concepts of OOPS?

There are four principle concepts upon which object oriented design and programming rest. They are:
(i.e. easily remembered as A-PIE).