Hi..
my problem is simple...i want to know which statement will result in more efficient and faster executing code..
if(char1.equals(':')||char1.equals(';')||char1.equals('.')||etc....)
{
//do something
}
OR
switch (char1)
case ':' : //dosomething
case ';' : //dosomething
case '.' : //dosomething
etc....
Please explain in terms of bytecode lines and execution speed and suggest me which one is better ..
Thanks
Sonali.
my problem is simple...i want to know which statement will result in more efficient and faster executing code..
if(char1.equals(':')||char1.equals(';')||char1.equals('.')||etc....)
{
//do something
}
OR
switch (char1)
case ':' : //dosomething
case ';' : //dosomething
case '.' : //dosomething
etc....
Please explain in terms of bytecode lines and execution speed and suggest me which one is better ..
Thanks
Sonali.