About Question enthuware.ocajp.i.v8.2.1025 :
Moderator: admin
-
- Posts: 14
- Joined: Tue Jun 02, 2015 8:32 am
- Contact:
About Question enthuware.ocajp.i.v8.2.1025 :
Why had this question got six options on it. I am not going to get six options to choose from in the exam am I?
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1025 :
You very well may. We have seen candidates get more than 7 options, sometimes even 8!
-
- Posts: 35
- Joined: Sat Nov 25, 2017 4:13 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1025 :
Code: Select all
try {
s = new ServerSocket(3030);
}
catch(Exception t){ t.printStackTrace(); }
catch(IOException e) {
s = new ServerSocket(4040);
}
catch(Throwable t){ t.printStackTrace(); }
Thank you in advance.
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1025 :
1. What happened when you tried to compile it?
2. Did you read the explanation that is given with this option?
2. Did you read the explanation that is given with this option?
-
- Posts: 35
- Joined: Sat Nov 25, 2017 4:13 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1025 :
Code: Select all
class Eh4 //try with multiple catch
{
public static void main(String args[])
{
try
{
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
int r=a/b;
System.out.println("ans="+r);
}
catch(NumberFormatException g)
{
System.out.println("Wrong Data");
}
catch(ArrayIndexOutOfBoundsException s)
{
System.out.println("Missing Data");
}
catch(ArithmeticException r)
{
System.out.println("Invalid Operation");
}
catch(Exception o)
{
System.out.println("Other Error");
}
}}
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1025 :
That's good. But try it with same variable name as well and see what happens.
Who is online
Users browsing this forum: No registered users and 5 guests