Set - 7

Question 1 :

What is the difference between a Scrollbar and a ScrollPane?

Answer :

A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.


Question 2 :

What is the difference between a public and a non-public class?

Answer :

A public class may be accessed outside of its package. A non-public class may not be accessed outside of its package.


Question 3 :

To what value is a variable of the boolean type automatically initialized?

Answer :

The default value of the boolean type is false.


Question 4 :

Can try statements be nested?

Answer :

Try statements may be tested.


Question 5 :

What is the difference between the prefix and postfix forms of the ++ operator?

Answer :

The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation on that value.