Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

enabling & disabling assertions programatically

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Q1] Can assertions be enabled or disabled programatically? If so, how?

Q2] Can we find out the assertion status of a class through code? If so, how?

Thanks
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Q1] Can assertions be enabled or disabled programatically? If so, how?



No you can't enable or disable assertions programatically.

Q2] Can we find out the assertion status of a class through code? If so, how?



No it is not possible.
 
Jayant Raj
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found out that the answers to both my questions were yes...

Please check out these links..

1] http://www.ociweb.com/jnb/jnbApr2002.html

2] http://docs.sun.com/app/docs/doc/806-7930/6jgp65ikr?a=view
 
Priya Jothi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jayant,

Sorry..Im not aware of this classloader class.So I feel someone else could help you in this.Then u'll not be tested how to disable / enable assertions programatically in the exam.Mostly u'll be asked questions like if assertions is enabled or disable what would be the output.

Regards,
Priya.
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic