Set - 1

Question 11 :

Which containers use a border layout as their default layout?

Answer :

The Window, Frame and Dialog classes use a border layout as their default layout.

Question 12 :

How are Observer and Observable used?

Answer :

Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated, it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.

Question 13 :

What is Java?

Answer :

Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly.

Question 14 :

What does a well-written OO program look like?

Answer :

A well-written OO program exhibits recurring structures that promote abstraction, flexibility, modularity and elegance.

Question 15 :

Can you have virtual functions in Java?

Answer :

Yes, all functions in Java are virtual by default. This is actually a pseudo trick question because the word "virtual" is not part of the naming convention in Java (as it is in C++, C-sharp and VB.NET), so this would be a foreign concept for someone who has only coded in Java. Virtual functions or virtual methods are functions or methods that will be redefined in derived classes.