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

Author Question: What is k after the following block executes?{ int k = 2; nPrint("A message", k);}System.out.println(k); (Read 60 times)

anshika

  • Hero Member
  • *****
  • Posts: 510

Question 1

A variable defined inside a method is referred to as ________.
◦ a method variable
◦ a block variable
◦ a global variable
◦ a local variable

Question 2

What is k after the following block executes?

{
int k = 2;
nPrint("A message", k);
}
System.out.println(k);

◦ 0
◦ 1
◦ 2
◦ k is not defined outside the block. So, the program has a compile error


Related Topics

Need homework help now?

Ask unlimited questions for free

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

Koolkid240

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




anshika

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


sultansheikh

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

 

Did you know?

Approximately 500,000 babies are born each year in the United States to teenage mothers.

Did you know?

As many as 20% of Americans have been infected by the fungus known as Histoplasmosis. While most people are asymptomatic or only have slight symptoms, infection can progress to a rapid and potentially fatal superinfection.

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?

All patients with hyperparathyroidism will develop osteoporosis. The parathyroid glands maintain blood calcium within the normal range. All patients with this disease will continue to lose calcium from their bones every day, and there is no way to prevent the development of osteoporosis as a result.

Did you know?

Prostaglandins were first isolated from human semen in Sweden in the 1930s. They were so named because the researcher thought that they came from the prostate gland. In fact, prostaglandins exist and are synthesized in almost every cell of the body.

For a complete list of videos, visit our video library