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
NeTakaya
2 years ago
14

You are given a class named Clock that has one int instance variable called hours.

Computers and Technology
1 answer:
Vlad [161]2 years ago
7 0

Answer:

public Clock(int hours) {

       this.hours = hours;

   }

Explanation:

In Java programming language, Constructors are special methods that are called to initialize the variables of a class when a new object of the class is created with the new keyword. Consider the complete code for the class below;

<em>public class Clock {</em>

<em>    private int hours;</em>

<em>    public Clock(int hours) {</em>

<em>        this.hours = hours;</em>

<em>    }</em>

<em>}</em>

In this example above,  an object of this class can created with this statement Clock myclock = new Clock(6); This is a call to the constructor and passes a parameter (6) for hours

You might be interested in
Comments can be hidden by clicking the _____ button.
Tamiku [17]
C because previous sends you back to something before such as a web page, Next does the opposite and I can't remember what Show MarkUp does.

5 0
3 years ago
Microsoft, Intuit and, Yahoo are building new facilities in Quincy, WA, a town that previously had a population of 3,500. Along
sveticcg [70]

Answer:

Economic.

Explanation:

In the following scenario, In Quincy, WA, a community that formerly would have a community of 3,500, they are developing new infrastructure. In addition to such friends and neighbors, Quincy citizens will also be seeing more traffic signals, a shopping center, rising property prices, and new opportunities.

So, the following scenario is best suited for the economic changes.

5 0
3 years ago
What will be printed when the method printstuff is called?
abruzzese [7]
Here is the correct answer of the given question above. The one that will be printed when the method printstuff is called is that there will be a compile error because a double cannot be assigned to an int <span>without a cast. Hope this answer helps. </span>
3 0
3 years ago
Task location is less important than the task language. T or F
Arlecino [84]
I really think its false because of the task  language you need to know
8 0
3 years ago
Hardware parts with images​
Inessa [10]
There is nothing here I’m sorry that I can’t hel
6 0
2 years ago
Read 2 more answers
Other questions:
  • A _______ is smaller than a notebook or laptop and has a touchscreen and sometimes a pointing device.
    13·1 answer
  • What three steps Name a group??
    14·1 answer
  • Discuss the use of distributed (federated) authentication systems in use at your institution. If no such system is in use, then
    5·1 answer
  • ) Briefly describe the purpose of the DASH protocol in streaming videos.
    9·1 answer
  • Which best explains a password attached to a document?
    7·1 answer
  • Write a method called min that takes three integers as parameters and returns the smallest of the three values, such that a call
    13·1 answer
  • What is modularity? Help asap
    9·1 answer
  • Beyond adding equations, what else does the Insert Equation feature allow users to do?
    7·1 answer
  • Hey should I get a r()blox gift card if so what amount 5 dollars 10 or 100
    14·1 answer
  • Select the correct answer.<br><br> Which statement is true with respect to Java?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!