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

Author Question: What is y displayed in the following code?public class Test { public static void main(String[] args) ... (Read 72 times)

Coya19@aol.com

  • Hero Member
  • *****
  • Posts: 601

Question 1

What is i printed in the following code?

public class Test {
public static void main(String[] args) {
int j = 0;
int i = j++ + j * 5;
System.out.println("What is i? " + i);
}
}

◦ 5
◦ 1
◦ 0
◦ 6

Question 2

What is y displayed in the following code?

public class Test {
public static void main(String[] args) {
int x = 1;
int y = x++ + x;
System.out.println("y is " + y);
}
}

◦ y is 1.
◦ y is 2.
◦ y is 3.
◦ y is 4.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by Coya19@aol.com on May 6, 2020

jasonq

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




Coya19@aol.com

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


alexanderhamilton

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

 

Did you know?

Thyroid conditions may make getting pregnant impossible.

Did you know?

In the ancient and medieval periods, dysentery killed about ? of all babies before they reach 12 months of age. The disease was transferred through contaminated drinking water, because there was no way to adequately dispose of sewage, which contaminated the water.

Did you know?

Many medications that are used to treat infertility are injected subcutaneously. This is easy to do using the anterior abdomen as the site of injection but avoiding the area directly around the belly button.

Did you know?

Hypertension is a silent killer because it is deadly and has no significant early symptoms. The danger from hypertension is the extra load on the heart, which can lead to hypertensive heart disease and kidney damage. This occurs without any major symptoms until the high blood pressure becomes extreme. Regular blood pressure checks are an important method of catching hypertension before it can kill you.

Did you know?

About 3.2 billion people, nearly half the world population, are at risk for malaria. In 2015, there are about 214 million malaria cases and an estimated 438,000 malaria deaths.

For a complete list of videos, visit our video library