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
Edhesive assignment 1 movie ratings
Oliga [24]

Answer:

ok

Explanation:

3 0
3 years ago
You have found statistics on the Internet that you would like to use in your speech.
miss Akunina [59]

Answer:

You cite them correctly and that the statistics are real.

Explanation:

5 0
3 years ago
When a user utilizes another computer to communicate with a third party, with the result that the third party cannot recognize t
avanturin [10]

Answer:

Online or Web Proxy

Explanation:

Web or online proxy allows you to hide your Internet Protocol (IP) address from the website you are trying to visit or access. It is like a shield between the website you are accessing and you. They can be seen as a middleman between you and the site you are visiting and as such, the site sees that a specific IP address is accessing its server but the address is not yours as all requests between your computer and the web server are first passed through the proxy server.

<em>Hope this helps!</em>

4 0
3 years ago
Visual Basic: What are arrays, please give an example code.
Drupady [299]

Answer:

An array is a collection of similar types of data. For example, if we want to store the names of 100 people then we can create an array of the string type that can store 100 names. String[] array = new String[100];

<h2>HOPE ITS HELPS YOU</h2>

4 0
2 years ago
Read 2 more answers
Anyone knows the answer for 6.1.4 Happy Birthday! codehs
Neko [114]

cvm is good cvm is great

7 0
2 years ago
Other questions:
  • What does sampling accomplish? Choose all that
    11·1 answer
  • The Magic Square is a grid with 3 rows and 3 columns with the following properties: • The grid contains every number from 1 to 9
    9·1 answer
  • Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline.
    15·1 answer
  • Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer pr
    15·1 answer
  • To drive defensively means taking proactive measures to avoid accident situations regardless of their potential causes.
    6·2 answers
  • What are 2 main differences betweenarrays andstructs?
    7·1 answer
  • Special words are those words that start and end with the same letter. [14]
    12·1 answer
  • Which list shows a correct order of mathematical operations that would be used by a spreadsheet formula?
    5·2 answers
  • JUST NEED TO KNOW WHO ALL DOSE EDGINUITY
    12·2 answers
  • What videos do you think we should make next?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!