Bookmark Topic Watch Topic
  • New Topic

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

 
NarayanaRao Konakalla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please Use One Thread Per Question. Let's continue here.
 
    Bookmark Topic Watch Topic
  • New Topic