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

Author Question: How can you initialize an array of two characters to 'a' and 'b'? (Read 49 times)

jjjetplane

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

Question 1

Which of the following statements is valid?
◦ double d[] = new double[30];
◦ int i = new int(30);
◦ char[] c = new char[4]{'a', 'b', 'c', 'd'};
◦ char[] c = new char();
◦ int[] i = {3, 4, 3, 2};

Question 2

How can you initialize an array of two characters to 'a' and 'b'?
◦ char[2] charArray = {'a', 'b'};
◦ char[] charArray = new char[2]; charArray = {'a', 'b'};
◦ char[] charArray = {'a', 'b'};
◦ char[] charArray = new char[]{'a', 'b'};


Related Topics

Need homework help now?

Ask unlimited questions for free

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

underwood14

  • Sr. Member
  • ****
  • Posts: 346
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 55% of students answer this correctly




jjjetplane

  • Member
  • Posts: 556
Reply 2 on: May 6, 2020
Excellent


hramirez205

  • Member
  • Posts: 345
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

On average, someone in the United States has a stroke about every 40 seconds. This is about 795,000 people per year.

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?

A good example of polar molecules can be understood when trying to make a cake. If water and oil are required, they will not mix together. If you put them into a measuring cup, the oil will rise to the top while the water remains on the bottom.

Did you know?

In 1886, William Bates reported on the discovery of a substance produced by the adrenal gland that turned out to be epinephrine (adrenaline). In 1904, this drug was first artificially synthesized by Friedrich Stolz.

Did you know?

Drugs are in development that may cure asthma and hay fever once and for all. They target leukotrienes, which are known to cause tightening of the air passages in the lungs and increase mucus productions in nasal passages.

For a complete list of videos, visit our video library