Java~Fool
BAN USER
Comments (4)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
public class usTOthem
{
public static void main(String[] args)
{
String st = "Us? It usually rains when bus comes to us";
String splitArr[] = st.split(" ");
for (int i = 0; i < splitArr.length; i++)
{
if(splitArr[i]=="us")
{
splitArr[i] = "them";
}
}
for(String modified: splitArr)
{
System.out.println(modified);
}
}
}
But still not working..help
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
finally block will execute EVERYTIME EXCEPT.... 1)before finally Block, JVM Shutdowns the existing Program anyhow 2) if there is unhandled exception in finally block. Eg:-System.exit(); .... simple as that
Even a return statement in any try - catch block will not stop the execution of finally block. (Tried and Tested :0 )
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
3 no more, no less
- Java~Fool October 23, 2012