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 67 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
YES! Correct, THANKS for helping me on my review


blakcmamba

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

 

Did you know?

More than one-third of adult Americans are obese. Diseases that kill the largest number of people annually, such as heart disease, cancer, diabetes, stroke, and hypertension, can be attributed to diet.

Did you know?

On average, the stomach produces 2 L of hydrochloric acid per day.

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.

Did you know?

Children with strabismus (crossed eyes) can be treated. They are not able to outgrow this condition on their own, but with help, it can be more easily corrected at a younger age. It is important for infants to have eye examinations as early as possible in their development and then another at age 2 years.

Did you know?

ACTH levels are normally highest in the early morning (between 6 and 8 A.M.) and lowest in the evening (between 6 and 11 P.M.). Therefore, a doctor who suspects abnormal levels looks for low ACTH in the morning and high ACTH in the evening.

For a complete list of videos, visit our video library