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

Author Question: Which method do you use to find the number of elements in a set or list named x? (Read 26 times)

joblessjake

  • Hero Member
  • *****
  • Posts: 555

Question 1

Suppose ArrayList x contains three strings [Beijing, Singapore, Tokyo]. Which of the following methods will cause runtime errors?
◦ x.get(2)
◦ x.set(3, "New York");
◦ x.remove(3)
◦ x.size()
◦ x.get(3)

Question 2

Which method do you use to find the number of elements in a set or list named x?
◦ x.count()
◦ x.size()
◦ x.sizes()
◦ x.counts()
◦ x.length()


Related Topics

Need homework help now?

Ask unlimited questions for free

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

sierrahalpin

  • Sr. Member
  • ****
  • Posts: 329
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




joblessjake

  • Member
  • Posts: 555
Reply 2 on: May 6, 2020
Great answer, keep it coming :)


JCABRERA33

  • Member
  • Posts: 344
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

Green tea is able to stop the scent of garlic or onion from causing bad breath.

Did you know?

Pubic lice (crabs) are usually spread through sexual contact. You cannot catch them by using a public toilet.

Did you know?

As many as 28% of hospitalized patients requiring mechanical ventilators to help them breathe (for more than 48 hours) will develop ventilator-associated pneumonia. Current therapy involves intravenous antibiotics, but new antibiotics that can be inhaled (and more directly treat the infection) are being developed.

Did you know?

Elderly adults are at greatest risk of stroke and myocardial infarction and have the most to gain from prophylaxis. Patients ages 60 to 80 years with blood pressures above 160/90 mm Hg should benefit from antihypertensive treatment.

Did you know?

Eat fiber! A diet high in fiber can help lower cholesterol levels by as much as 10%.

For a complete list of videos, visit our video library