Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception handling and inner classes

 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q) Which of the following requires explicit exception handling or rethrowing?
1) Traversing each member of an int array.
2) Traversing each member of an object array.
3) Attemting to open a file.
4) Attempting to read from a file.
5) Attempting to open a network socket.
6) Accessing a method in other class.
7) Calling a method defined with a throws clause.
Q) Which statements are true?
1) An inner class may be defined as static.
2) An inner class may NOT be defined as private.
3) Anonymous inner class may have only one constructor.
4) An inner class may extend another class.
5) Anonymous inner class may only be created within the body of a method.
6) Anonymous inner class can only access static fields of enclosing class.
7) Anonymous inner class has to be deslared and instantiated in the same place.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amit,
Instead of just posting questions out here, why not post the question along with what you think the answers are and why? If you're mistaken, we can then give you much more help than if I were to just blurt out answers to you.
[ August 19, 2003: Message edited by: Corey McGlone ]
 
Shafkat Talli
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by the way, my english isnt very good, what does Traversing really mean ?
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The definition given from dictionary.com reads like this:

To travel or pass across, over, or through.

In the case of data structures, as we're talking about here, we're talking about moving from one element of the data structure to the next. Therefore, traversing an int array would be the process of going through each element of that array - basically, "travelling" from one end to the other.
I hope that helps,
Corey
 
Shafkat Talli
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers, thanx.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic