Citrix System Inc Interview Question
Software Engineer / DevelopersTeam: Shared file
Country: United States
Interview Type: Phone Interview
public class testing {
public static void main(String[] args) {
String url="";
if(url.equals(""))
{
throw new BadUrlException("The url is incorrect");
}
}
}
public class BadUrlException extends RuntimeException{
/**
*
*/
private static final long serialVersionUID = -2913886560226448338L;
public BadUrlException(String s) {
super(s);
}
}
For better experience, you should first make package and call it myExceptions.
Then create a new class which inherit from Exception
Then to use it
- Ahmed Hamdy February 05, 2014