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
What naming scheme identifies the rows in a worksheet?
UNO [17]
The naming scheme would be b


3 0
3 years ago
Read 2 more answers
A raised dot (ú) shows where the ENTER key was pressed. <br> a. True<br> b. False
MatroZZZ [7]
Its false nothing comes up when u press that key
5 0
3 years ago
On what type of network can you rent things such as cars, tools, and rooms?
NeTakaya

Answer:

Sharing economy network

4 0
2 years ago
What is the purpose and what are some of the components of a wide area network connection?
Ilia_Sergeevich [38]

Answer:

WAN(wide area network) is the network that is used for the connection in the geographical areas on large scale.They are used for connecting the areas like cities, countries, states etc.The connection of various LANs(Local area network) and MAN(Metropolitan area network) form the WAN.

There are several components that are used in the wide area network structure. Some of the constituents are as follows:-

  • ATM()Asynchronous transfer mode
  • Fiber optic communication path
  • Modem having cables
  • Frame relay
  • Dial up internet etc.

5 0
3 years ago
Read 2 more answers
Use a while loop to repeatedly take input from the user and calculate a sum. The user will only be allowed to type in numbers, b
aev [14]

Answer and Explanation:

#take input from user

n = int(input("Enter any number: "))

#sum variable to store sum

sum=0

#condition to exit from loop

while n!=-999:

   #adding entered number in sum variable

  sum=sum+n

  #take input from user

  n = int(input("Enter any number : "))

#print the sum  

print("sum =",sum)

output:

Enter any number: 10

Enter any number : 100

Enter any number : -999

sum = 110

3 0
3 years ago
Other questions:
  • When composing a tweet with images attached in hootsuite, bear in mind that _____ characters are used up by the photos?
    9·1 answer
  • Which step can most directly help your team follow up on decisions made during Web development meetings?This task contains the r
    6·1 answer
  • In your own words, describe the advantages and disadvantages of the auto-negotiation protocol used in Ethernet communications.
    6·1 answer
  • Keep the base of your _________ on the mouse pad or desk?
    12·2 answers
  • A ___ is a node (or a device) that connects two different networks together and allows them to communicate.
    12·1 answer
  • Define Class in C++. Briefly discuss.
    9·1 answer
  • A computer processes data using only 1s and 0s true or false?
    9·2 answers
  • Think of an aspect of HTML that you found challenging to master. Why is that aspect of HTML important? What are some future situ
    6·1 answer
  • What is the computer generation​
    15·1 answer
  • Which of the following uses the proper syntax for creating an HTML comment?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!