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
Simora [160]
4 years ago
15

What is the output of the second println statement in the main method?

Computers and Technology
1 answer:
Doss [256]4 years ago
3 0

Answer:

B. f2.i is 1 f2.s is 2

Explanation:

In Java there are two type of variables, first is static variables and second is instance variable. static variable class variable which means you can have only one variable for all instance of that class. But instance variable will only for instance/object of that class.

For this code example, i is and instance variable, for every instance of class Foo, there will be separate i variable. but s is a static variable and that will be associated with class.

So in this program the first instance incremented the s variable and changed its value to 1 as int's default value is 0 in the constructor. So for second instance, the s value changed to 2 that's why it prints f2.s as 2 and as we know i is instance variable and every instance of foo class have there own copy of i variable so it's value will remain same for every instance.

You might be interested in
Which term describes computers (e.g., Windows PC, Mac OS X) with applications that allow a person to perform diverse tasks, from
Oksanka [162]

Answer:

D. Application computers

Explanation:

Application are a set of software programs that run on your computer. These programs are designed to perform specific tasks. These task can range from writing a book on CompTIA A+ certification to talking with someone, with full audio and video.

3 0
4 years ago
What is an html skeleton? If you know what it is can you write it for me?
shtirl [24]

Answer:

HTML Skeleton. The basic HTML skeleton is the set of tags required of every HTML web page you build. The tags that make up the skeleton tell browsers what kind of file it is reading, and without the skeleton HTML files will not be rendered correctly in web browsers. There are four tags that need to be included in the skeleton.

Explanation:

5 0
3 years ago
Ites and days, on one of the slides in her school presentation. Which element can she use to
Lady_Fox [76]
<h2>Answer:</h2><h3>A text</h3><h3>or</h3><h3>C chart</h3>

8 0
3 years ago
Read 2 more answers
In most signal "timing diagrams" (like the one below) the signals do not change from low to high, or from high to low, abruptly.
melisa1 [442]

Explanation:

This transient state occurs due to the fact that the signal change from low to high and high to low doesn't occur intermediately but in a very small time, in relation to the signal time itself.

At transistor level there are parasitic (undesired) capacitances and resistances, formed due to the layout configuration of conductor and dielectrics. As consequence a RC circuit is formed, thus making a propagation delay.

This delay must be characterized for each circuit, and specified as tpHL (transition time from High to Low) and tpLH (transition time from Low to High)

8 0
3 years ago
How does data structure affect the programs we use​
Semmy [17]

Answer The data structure and algorithm provide a set of techniques for that program in order for it to function. think of it like yt

Explanation:

7 0
3 years ago
Other questions:
  • a problem-solving approach that requires defining the scope of a system, dividing it into its components, and then identifying a
    8·1 answer
  • What does the action tool allow you to do in Microsoft Powerpoint?
    15·1 answer
  • The light source for a typical silhouette is generally___________ the subject.
    12·2 answers
  • Write a method, including the method header, that will receive an array of integers and will return the average of all the integ
    7·1 answer
  • Advantages of a grain crush​
    9·1 answer
  • What are some limitations when it comes to testing and ensuring program quality? List at
    15·1 answer
  • Give five example of a dedicated device ​
    9·2 answers
  • 20
    8·1 answer
  • Write A Code In Python
    8·2 answers
  • Give me reasons why Harry Potter is bad and anime is better
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!