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 62 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
Thanks for the timely response, appreciate it


raili21

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

 

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?

The Centers for Disease Control and Prevention has released reports detailing the deaths of infants (younger than 1 year of age) who died after being given cold and cough medications. This underscores the importance of educating parents that children younger than 2 years of age should never be given over-the-counter cold and cough medications without consulting their physicians.

Did you know?

Normal urine is sterile. It contains fluids, salts, and waste products. It is free of bacteria, viruses, and fungi.

Did you know?

The eye muscles are the most active muscles in the whole body. The external muscles that move the eyes are the strongest muscles in the human body for the job they have to do. They are 100 times more powerful than they need to be.

Did you know?

Astigmatism is the most common vision problem. It may accompany nearsightedness or farsightedness. It is usually caused by an irregularly shaped cornea, but sometimes it is the result of an irregularly shaped lens. Either type can be corrected by eyeglasses, contact lenses, or refractive surgery.

For a complete list of videos, visit our video library