Assume that errorCount is a variable of type int that has been declared and given a value. Write an expression whose value is a reference to a newly created Exception object whose message is the string “too many errors:” followed by the value of errorCount.
LANGUAGE: JAVA
CHALLENGE:
Assume that errorCount is a variable of type int that has been declared and given a value. Write an expression whose value is a reference to a newly created Exception object whose message is the string “too many errors:” followed by the value of errorCount.
SOLUTION:
new Exception("too many errors: " + errorCount)