• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Assertion enabled and disabled Question?

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

For the following question the answer is �A�,�B� and �D�. I agree with the answer �B� and �D�. But I won�t agree with the answer �A� because the �A� is already disabled by assertion. Pls let me know, If am I missing anything.

Thanks, Raghu.K


Question: -
The package favorite.fruits contains different classes for different fruits. Mango and Apple are in this package. Pineapple and Orange are in the package citrus, which is a sub package of favorite.fruits. Assume that all these classes are compiled with
Assertions enable. Given the following command at the command prompt, which of the following classes would have assertions enabled?

java -ea:favorite.fruits... -da:favorite.fruits.Apple favorite.fruits.Mango

Answer:-
A) favorite.fruits.Mango
B) favorite.fruits.citrus.Pineapple
C) favorite.fruits.Apple
D) favorite.fruits.citrus.Orange
E) net.util.FTPMan
 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java -ea:favorite.fruits... -da:favorite.fruits.Apple favorite.fruits.Mango

Mango is the class which you are running . Disabled for Apple class only.


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

what is syntex,if i need to disable morethan one class.

Thanks, Raghu.K
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then you have to write



enable assertion in general for package favorite.fruits but disable for the listed classes Mango and Apple


Naseem
 
reply
    Bookmark Topic Watch Topic
  • New Topic