Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Couple of questions

 
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a synchronized method throws an exception the thread give up the lock.. TRUE or FALSE
Anonymous class cant be declared as static ... TRUE or FALSE

Please let me know
Ragu
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a synchronized method throws an exception the thread give up the lock.. TRUE or FALSE
TRUE, From JLS 17.3


...
If execution of the method's body is ever completed, either normally or abruptly, an unlock action is automatically performed on that same lock.


Anonymous class cant be declared as static ... TRUE or FALSE
TRUE, From JLS 15.9.5:


15.9.5 Anonymous Class Declarations
An anonymous class declaration is automatically derived from a class instance creation expression by the compiler.
An anonymous class is never abstract (�8.1.1.1). An anonymous class is always an inner class (�8.1.2); it is never static (�8.1.1, �8.5.2). An anonymous class is always
implicitly final (�8.1.1.2).


HIH

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic