• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assertion enabled and disabled Question?

 
RAGU KANNAN
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • 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
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic