1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
wariber [46]
3 years ago
7

2-Write test programs in java to determine the scope of a variable declared in a for statement. Specifically, the code must dete

rmine whether such a variable is visible after the body of the for statement

Computers and Technology
1 answer:
ankoles [38]3 years ago
7 0

Answer:

See Explaination

Explanation:

public class testscope

{

//start of main function

public static void main(String[] args)

{

//varible declration

int i;

int x;

//loop for 10 times

for(i=0; i<10; i++)

{

//initialize value of x to 10

x = 10;

}

//the scope of variable x is visible outside of for loop

System.out.println("The value of x is: "+x);

}

}

See attachment for sample output

nb:

You can clearly see in the output of Java program the value of x is not printed and program return errors. It means the variable x declared inside for loop does not has scope outside the for loop.

You might be interested in
Thiết kế biểu đồ thực thể liên kết và tập lược đồ cơ sở dữ liệu quan hệ cho các bài toán quản lý sau:
Paladinen [302]

Answer:

sorry please write in English than i help.you i don't understand your language

3 0
3 years ago
This graph shows a relationship between the height of a giraffe and its weight which term describe the dashed line through the g
Nadusha1986 [10]

Answer: The Answer is C

Explanation: This is because It is mainly controlled by genetics and we can not manipulate genetics.

4 0
3 years ago
Read 2 more answers
Assume your sketch has a variable named silo, which stores an object that is defined by a class you have created. The name of th
yulyashka [42]

Answer:

c. let v = silo.volume();

Explanation:

When you create and initialize a new object you pass through that object's class constructor. The constructor is in charge of initializing all the necessary variables for that class including radius and height. Once you save the object in a specific variable (silo) you need to call the class methods through that variable, using the '.' command. Therefore, in this scenario, in order to call the volume() method you would need to call it from the silo object and save it to the v variable, using the following statement.

let v = silo.volume();

7 0
2 years ago
How do you flash your high beams ?​
Bad White [126]

Answer: to flash your high beams you have to basically put on and turn them off really quickly here is what the button looks like :)

Hope this helps you out :)

7 0
3 years ago
Read 2 more answers
Directions: Fill in the blanks with the appropriate word in each statement below.
mart [117]

Answer:

sbysgscd CD CD vdhdudiididjehgegeueuheve gf hdgowincobwbciehidgwdgiwigwdigxifqugwljvwvwxi2dvwvwxixwvwxvqvwivqi

xwv2digwxivwiw

wxvixbowowxowcohwco2ch2od

odhowhowcowcohwxohwdowdjeciwr

hiwdodwobwdvqoo230ie

9qhowwdhwdigwdoieexohxiefbeoc

hwdhefgdegedogex

Explanation:

9hwx9hex9hexobeb8xgx9jcr

jd2oh2ih2xi2dd2oxivqsg8xwohjgwxohdeohwxihwdoeciwxgiweiguofyoe5u5ew46w57lrroyvyreiyfe1ei2ei2idxwdooydyofpiwigpwxwduo1zuo1dif3o4y

2hupv2rxou2xu2du2d

ou1svxiexuowvouqdip2dpwcuowd2u

qxigqedouovqudipgqipwgipcwpi2di2ipegpi2efpi2dipe2ip1dgxip2ce1piecg1peix1ou2co2dpu1ecgip1eip1deg1euouoeupdeuofour68ditsoysrs27ro457uoeigpexupgeip3dpiwdguof<em>o</em><em>y</em><em>i</em><em>y</em><em>y</em><em>i</em><em>d</em><em>i</em><em>y</em><em>u</em><em>f</em><em>u</em><em>o</em><em>u</em><em>o</em><em>d</em><em>y</em><em>i</em><em>d</em><em>y</em><em>o</em><em>u</em><em>o</em><em><u>o</u></em><em><u>u</u></em><em><u>u</u></em><em><u>p</u></em><em><u>w</u></em><em><u>d</u></em><em><u>9</u></em><em><u>d</u></em><em><u>e</u></em><em><u>d</u></em><em><u>i</u></em><em><u>w</u></em><em><u>g</u></em><em><u>i</u></em><em><u>p</u></em><em><u>2</u></em><em><u>s</u></em><em><u>o</u></em><em><u>u</u></em><em><u>2</u></em><em><u>s</u></em><em><u>g</u></em><em><u>9</u></em><em><u>2</u></em><em><u>3</u></em><em><u>u</u></em><em><u>g</u></em><em><u>o</u></em><em><u>1</u></em><em><u>3</u></em><em><u>u</u></em><em><u>e</u></em><em><u>f</u></em><em>c</em><em>i</em><em>d</em><em>y</em><em>i</em><em>d</em><em>5</em><em>7</em><em>g</em><em>d</em><em>q</em><em>i</em><em>g</em><em>e</em><em>o</em><em>b</em><em>x</em><em>r</em><em>i</em><em>1</em><em>e</em><em>i</em><em>y</em><em>f</em><em>2</em><em>i</em><em>p</em><em>e</em><em>c</em><em>h</em><em>k</em><em>c</em><em>y</em><em>i</em><em>d</em><em>o</em><em>u</em><em>x</em><em>t</em><em>u</em><em>x</em><em>u</em><em>o</em><em>c</em><em>z</em><em>i</em><em>y</em><em>c</em><em>y</em><em>i</em><em>y</em><em>y</em><em>i</em><em>y</em><em>i</em><em>y</em><em>2</em><em>i</em><em>d</em><em>y</em><em>i</em><em>g</em><em>x</em><em>y</em><em>i</em><em>y</em><em>i</em>yiydiyyiiyciyc2ouvyidyiyidydyidiyf7uo2vu1e

8 0
3 years ago
Other questions:
  • Describe encryption at gateways in thePresentation layer of the OSI Reference Model
    6·1 answer
  • You have been hired to set up a network for XYZ Enterprises. What factors will you consider to determine the type of network nee
    7·2 answers
  • Hi <br> What exactly does this project want from me?thanks for riding
    5·1 answer
  • What natural boundary separated british territory from louisiana?
    7·1 answer
  • Plagiarism occurs when writers
    14·2 answers
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • Who here has a crush on jk from bts but feels more mature than him
    10·2 answers
  • What is an insertion point?
    6·1 answer
  • Choose all items that represent examples of good website accessibility.
    8·2 answers
  • Which statement best explains the way that similar apps are used in different devices?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!