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 68 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
:D TYSM


steff9894

  • Member
  • Posts: 337
Reply 3 on: Yesterday
Wow, this really help

 

Did you know?

Though the United States has largely rejected the metric system, it is used for currency, as in 100 pennies = 1 dollar. Previously, the British currency system was used, with measurements such as 12 pence to the shilling, and 20 shillings to the pound.

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.

Did you know?

The most common childhood diseases include croup, chickenpox, ear infections, flu, pneumonia, ringworm, respiratory syncytial virus, scabies, head lice, and asthma.

Did you know?

More than 150,000 Americans killed by cardiovascular disease are younger than the age of 65 years.

Did you know?

Complications of influenza include: bacterial pneumonia, ear and sinus infections, dehydration, and worsening of chronic conditions such as asthma, congestive heart failure, or diabetes.

For a complete list of videos, visit our video library