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

Urgent help needed.How to skip a LOC execution in method def

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi
I would like to get a clue about how to skip execution of a line of code in a method definition.Below is the scenario.

public PublicClass{

public void methodA(){

line1;
line2;
line3;

}
public static void main(String args){

PublicClass pc = new PublicClass();

pc.methodA();

}

}

That is the scenario.How could i see that line3 is not executed when the method methodA() is invoked in main method.
But, line3 should not be commented or any conditions should not be checked in methodA() definition.we should control this execution(skipping line3) from outside that methodA() definition.
Acutally this line3 has to be skipped as a part of testing.Hope i'll get help very soon.

Thanks
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please Use One Thread Per Question. Let's continue here.
 
Skool. Stay in. Smartness. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic