This topic contains a solution. Click here to go to the answer

Author Question: What exception type does the following program throw?public class Test { public static void ... (Read 19 times)

tnt_battle

  • Hero Member
  • *****
  • Posts: 556

Question 1

What exception type does the following program throw?

public class Test {
public static void main(String[] args) {
String s = "abc";
System.out.println(s.charAt(3));
}
}

◦ ArithmeticException
◦ ArrayIndexOutOfBoundsException
◦ StringIndexOutOfBoundsException
◦ ClassCastException
◦ No exception

Question 2

What exception type does the following program throw?

public class Test {
public static void main(String[] args) {
Object o = new Object();
String d = (String)o;
}
}

◦ ArithmeticException
◦ ArrayIndexOutOfBoundsException
◦ StringIndexOutOfBoundsException
◦ ClassCastException
◦ No exception


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by tnt_battle on May 6, 2020

tuwy

  • Sr. Member
  • ****
  • Posts: 336
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




tnt_battle

  • Member
  • Posts: 556
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


deja

  • Member
  • Posts: 332
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

The highest suicide rate in the United States is among people ages 65 years and older. Almost 15% of people in this age group commit suicide every year.

Did you know?

According to animal studies, the typical American diet is damaging to the liver and may result in allergies, low energy, digestive problems, and a lack of ability to detoxify harmful substances.

Did you know?

Vital signs (blood pressure, temperature, pulse rate, respiration rate) should be taken before any drug administration. Patients should be informed not to use tobacco or caffeine at least 30 minutes before their appointment.

Did you know?

Women are two-thirds more likely than men to develop irritable bowel syndrome. This may be attributable to hormonal changes related to their menstrual cycles.

Did you know?

Interferon was scarce and expensive until 1980, when the interferon gene was inserted into bacteria using recombinant DNA technology, allowing for mass cultivation and purification from bacterial cultures.

For a complete list of videos, visit our video library