• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Triggers - following Doug's post

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


- [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 ]
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Threads : look for syncronized block around wait and notify.
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic