Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#10. Exceptions 12 points erial 0/2 What is the output of the following code Segment? public class Exception { static int divider (int x, int

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
#10. Exceptions 12 points erial 0/2 What is the output of the following code Segment? public class Exception { static int divider (int x, int y) { try return x/y; } catch (ArrayIndexOutOfSoundsException a) ( System.out.print("A"); return 1; 3 1 static int computer(int x, int y){ try return divider(x,y): 2 catch (NullPointerException ) System.out.print(""); return 2: public static void main(String args) Int ! - computer (100, 0); } catch (ArithmeticException e) { System.out.print(""); # public static void main(String args) Time lei inti - computer (100): 2 catch (Arithmeticxception) System.out.print(""); ABC . A o O 6 #11 Arrays/indexing 12 points ras. 012 Time What is the outcome of the following code when executed? public class array public static void main(String args[]) int a[] = {10, 20); for (int 1-3; 1c-5;i++) System.out.print(a[i]); ) 3 O 1020 0 10 20 O ArithmeticException O ArrayIndexoutoroundsException None of the above 012 cht bove Tim #12. Exceptions and divide by zero 12 points tri: 013 What is the output of the following code? public class at public static void main(String args[]) float f-0.1F; double d..1; try ( System.out.println(/0); System.out.println(op/e): System.out.println(d/0); System.out.println(0/0) .) catch (ArithmeticException) System.out.print("EXCEPTION OCCURREO"); 2 Enter your responde here submit 13 Rinne #14 Writing objects to a file 2 points tra If a seriallable object consists of non-serializable instance data fields, then the user needs to mark the data field with keyword to make sure that this field should not be written to the object stream Enter your response here subot #15 Acording to a binary owth Flottstream 2 points 3 What is the word that I need in place of the blank > in the state blows that the file data dat will be opened and the next output to the file will at the end of the for leoutputStream("data.dat Er you to her TA Type here to search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions