Computer Science, asked by palakthakur3298, 1 year ago

Fill in the blanks to handle any possible exceptions. int x = 12; int y = 0; for { int z = x / y; system.out.println(z); } (exception
e.{ system.out.println("error"); }

Answers

Answered by nitish8089
6

check \: out \: the \: code \: may \:
be \: helpful
Attachments:
Answered by yoodyannapolis
0

error will print on the console window

Explanation:

  • As the given code is in the java programming language in this given program we seen that the variable y is holding 0 that divides the variable x and store in z so there is exception will occur .i.e " divide by zero occur" how ever the exception occur when the run time code is wrong .
  • In this try block contains the code where the exception is occur and catch block handles such type of exception so catch block will handle the exception and code inside the catch block will run i,e error is print on console .

Learn More :

  • brainly.in/question/8560687

Similar questions