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
drek231 [11]
3 years ago
14

What is the output of the second println statement in the main method? public class Foo { int i; static int s; public static voi

d main(String[] args) { Foo f1 = new Foo(); System.out.println("f1.i is " + f1.i + " f1.s is " + f1.s); Foo f2 = new Foo(); System.out.println("f2.i is " + f2.i + " f2.s is " + f2.s); Foo f3 = new Foo(); System.out.println("f3.i is " + f3.i + " f3.s is " + f3.s); } public Foo() { i++; s++;
Computers and Technology
1 answer:
never [62]3 years ago
6 0

Answer:

The second print statement will print:

f2.i is 1 f2.s is 2

Explanation:

Initially when the execution start. i and s are both 0. i declared as a variable while s is a static variable which value stays once it is re-defined.

When f1 call i and s; their value is both 1 based on the increment statement in the constructor.

For the second print statement:

When f2 call i; it is re-initialized to 1. When f2 call s; it has initial value of 1 and is incremented to 2 which is printed. s hold the initial value of 1 because of the static keyword.

You might be interested in
For a panoramic photograph, you will more than likely want to control the exposure of the photograph yourself rather than lettin
Ronch [10]
When shooting panoramic you would want to control the exposure yourself, much rather than the camera..... A panoramic is one big picture correct, so you would want all of them to be the same exposure level, now some cameras may lock on, and others may not......your correct answer would be TRUE does this make sense?
8 0
4 years ago
Can anyone help me with getting bash ubuntu on windows setup?
marin [14]
<span>Open Applications -> Accessories -> Terminal.

Find where the .sh file. Use the ls and cd commands. ls will list the files and folders in the current folder. Give it a try: type "ls" and press Enter.
<span>
Run the .sh file. Once you can see for example script1.sh with ls run this: ./script.sh.

What windows do you have?))</span></span>
6 0
4 years ago
Which layer includes the physical transmission medium (cables or wireless media) that any network must use to send and receive t
Yuliya22 [10]

Answer:

The correct answer to the following question will be "Physical Layer".

Explanation:

  • The lowest layer of the OSI reference model is the physical layer. It's in charge of having to send bits from one desktop to the next.
  • This layer isn't acquainted with the interpretation of the parts and is concerned with setting up a physical wireless connection and sending and receiving signals.
  • This layer relies on aspects of the hardware, such as wires, transmitters, and network interface tokens.

Therefore, it will be the right answer.

4 0
3 years ago
Many websites (mostly online shopping sites), monitor a person’s Internet browsing behavior, such as the websites we often visit
mamaluj [8]

Answer:

Yes, this pratice is ethical

Explanation:

You are freely choosing to go on to these websites and most websites inform you that they are doing this. Edward Snowden, told the world that goverments are spying on them. Most people did not have a problem with this. Since, most people have a way to inform themsevles about the practices on the websites(by reading the terms of serve) and people don't care about spying than this is in no way unethical practice.

7 0
3 years ago
Please Help meeeeeeeeeee:
Akimi4 [234]

Answer:

D) save as

Explanation:

If you press save as it'll give you the option where to save to.

6 0
3 years ago
Read 2 more answers
Other questions:
  • "re-type the celsius_to_kelvin function. Change the name to kelvin_to_celsius, and modify the function accordingly."
    7·2 answers
  • What is an activity that can help you enhance the appearance of your computer’s desktop?
    12·2 answers
  • What is the definition of D1-D4?
    14·1 answer
  • Explain what it means to have good file management skills.
    10·1 answer
  • What is the purpose of the New Window command?
    7·2 answers
  • Which of the following was (and still is) used by computer programmers as a first test program?
    13·2 answers
  • If the old and new systems are operated side by side until the new system has proven itself, this type of system conversion plan
    11·1 answer
  • HELP ASAP!!!!<br> I don't know the code to these images and I need that code now.
    12·1 answer
  • Irene is creating a wireframe of a website she is working on to show her client. In which phase of the development process is sh
    13·1 answer
  • he memory protection requirement must be satisfied by the operating system rather than the processor. True False
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!