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
densk [106]
3 years ago
15

What output is produced by the following code? Integer first = new Integer(7); Integer second = first; if (first == second) Syst

em.out.println("Sneezy"); else System.out.println("Grumpy"); if (first.equals(second)) System.out.println("Sleepy"); else System.out.println("Doc"); Sneezy Sleepy Sneezy Doc Grumpy Sleepy Grumpy Doc
Computers and Technology
1 answer:
fenix001 [56]3 years ago
6 0

Answer:

The correct output of this question is  "Sneezy Sleepy".

Explanation:

In the given code firstly we create the object of the integer class that is first in this we pass the integer value that is 7. Then we declare another second integer variable is this variable we pass object as a reference. Then we use the two conditional statements. In the first, if block we check that the object of the class is equal to the reference variable. If it is true it prints Sneezy. otherwise, it will print Grumpy. In second if block we check that the object of the class is equal to the reference variable. but in this time we the equals() function it is the same as(==). If the condition is true it prints Sleepy. otherwise, it will print Doc. So the output of the code is Sneezy Sleepy.

You might be interested in
Using complete sentences post a detailed response to the following.
laiz [17]

Answer:

some advantages of top down is that you can start off from what you know and figure out what you need to complete it, advantages to bottom up is that you can make something new . if you are starting something from scratch and you dont know what the end goal might be you would use bottom up but if you already have an idea or the final product of what you want you would go the top down approach.

Explanation: just saying you shouldnt just copy and paste my response but rather pick out what you want to say and use this to complete what ever your working on. hope i helped :)

6 0
3 years ago
Read 2 more answers
Which keyboard shortcut cuts information to the clipboard?
anyanavicka [17]

Answer:

control X

Explanation:

It cuts and copies to clipboard

3 0
3 years ago
Which of the following is not a method for opening Word software?
neonofarm [45]

Answer:

right clicking on the desktop and clicking "view"

8 0
3 years ago
Read 2 more answers
Click to visit W3Schools.com
KonstantinChe [14]

Is this self advertising because its not a question so i have no answer for you and if i missed something on the website that was a question let me know

3 0
4 years ago
Read 2 more answers
Which of the following is a possible disadvantage of recursion? Question 10 options: Recursive solutions can be less efficient t
zavuch27 [327]

Answer:

Recursive solutions can be less efficient than their iterative counterparts

Explanation:

Recursion can be defined or described as a method of solving a problem where the solution depends on solutions to smaller instances of the same problem.

It entails using iteration to ensure that smaller parts of a solution are satisfied towards solving thw overall problem.

Ita major disadvantage seems to be that it seem to be less efficient than their iterative counterparts. This is as a result of concentrating on trying to solve a smaller instances.

4 0
3 years ago
Other questions:
  • This is the main work area of your computer.
    7·1 answer
  • How does emotional awareness help you with non-verbal communication?
    13·2 answers
  • Which field of study would be most useful for a person who wants to work in a recycling plant?
    12·2 answers
  • dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
    9·1 answer
  • what is hyperlink a)the text contained in hypertext documents b)a service provided by the internet c) the location of web pge on
    12·1 answer
  • Microsoft Word, Google Chrome, and Windows Media Player are examples of
    15·1 answer
  • Software licensed as proprietary
    11·2 answers
  • Did it surprise you to discover that the Sun is actually a star in the middle of its life cycle? Why or why not?
    8·1 answer
  • You can merge the cells using the rowspan and colspan attribute of the tag <br> true or false​
    7·1 answer
  • How dose computers it use the information to solve problems
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!