Page 1 of 1

HELP! This is a two-part single question so please answer both parts accordingly and provide work shown. For each of the

Posted: Sun May 15, 2022 10:25 am
by answerhappygod
HELP! This is a two-part single question so please answer both
parts accordingly and provide work shown.
For each of the following, describe why Java will or won't
complain. If it will, describe how to fix it.
1. A) var x = 1 / 2L - '3' * 4.0f + "5";
B) long y = console.nextByte();
C) if((2^7)>=5){Math.abs(-4);}
D) for(;;){;}
E) boolean false = false;
Concerning Exceptions, give detail:
2. A) What is an Exception?
B) Provide an example in pseudocode of
when you should throw an Exception.
C) In what ways are return and throw
similar? in what ways are they different