| Author |
Triggers - following Doug's post
|
Lisa French
Ranch Hand
Joined: Jun 17, 2003
Posts: 31
|
|
I thought this might be a good thread to start. Triggers to look for in code example test questions: Doug said that he looks for triggers in the code examples to immediately draw him toward a syntax error or non compilation issue. Copied from his post in another topic: - wait(), join(), sleep() : Look for try/catch block to catch InterruptedException. - case: x : Look for x as non-final variable... Compiler error. - [top level class] : Look for any other access modifier besides public and [default access]... Compiler error. - [non-anonymous, method-local, inner class] : Look for semi-colon at closing bracket. If not there... Compiler error. - ["final" base class method] : Look for shadowing in child method, access from child method. - [Wrapper Class].[Any Method] : SUPER CLOSE SCRUTINY! could be NFE Error, incorrect return type. Does anyone else have any good triggers?
|
 |
Brian Joseph
Ranch Hand
Joined: May 16, 2003
Posts: 160
|
|
- [non-anonymous, method-local, inner class] : Look for semi-colon at closing bracket. If not there... Compiler error. - ["final" base class method] : Look for shadowing in child method, access from child method.
Change non-anonymous to just anonymous Also, if you declare a base method as final, how can you "shadow" the method in a subclass? Because it's final you get a compile error at any attempt to override it. [ June 19, 2003: Message edited by: Brian Joseph ]
|
 |
Jon Poole
Ranch Hand
Joined: Jun 19, 2003
Posts: 31
|
|
|
Threads : look for syncronized block around wait and notify.
|
 |
Marlene Miller
Ranch Hand
Joined: Mar 05, 2003
Posts: 1391
|
|
static nested class: look for access to instance fields and instance methods of enclosing class (compiler error) non-static nested class: look for declaration of static field, static method or interface (compiler error)
|
 |
 |
|
|
subject: Triggers - following Doug's post
|
|
|