wood burning stoves 2.0*
The moose likes Java in General and the fly likes Urgent help needed.How to skip a LOC execution in method def Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

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

NarayanaRao Konakalla
Greenhorn

Joined: Jan 29, 2008
Posts: 13
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

Joined: Oct 27, 2005
Posts: 19680
    
  19

Please Use One Thread Per Question. Let's continue here.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: Urgent help needed.How to skip a LOC execution in method def