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
Yuki888 [10]
3 years ago
8

Write the definitions of two classes Day and Night. Both classes have no constructors, methods or instance variables. Note: For

this exercise, please do not declare your classes using the public visibility modifier.
Computers and Technology
1 answer:
Colt1911 [192]3 years ago
4 0

Answer:

class Day

{

}  

class Night

{

}

Explanation:

Given

Two classes named: Day and Night

Requirement: Both classes have no constructors, methods or instance variables. should not be declared using the public visibility modifier.

The syntax to define a class in object oriented programming is

modifier class classname {

 // Constructor

 constructor(variablename) { ......}

 // Methods

 methods() { ... }

 ...

}

Access modifiers (or access specifiers) are keywords in object-oriented languages that set the accessibility of classes, methods, and other members. Examples are private, public, protected, etc.

Going by the syntax above to define class Day

Day

private class Day{

 // Constructor

 constructor(duration)

{

this.duration = duration;

}

 // Methods

CalculateDate() { ... }

}

But the question states that both classes have no constructors, methods or instance variables. should not be declared using the public visibility modifier.

So, class Day will be defined as follows

class Day

{

}

It could also be declared using visibility modifiers other than public modifier.  So, class Day will be defined as follows

private class Day

{

}

and

protected class Day

{

}

Similarly, class Night can be defined as follows

class Night

{

}

private class Night

{

}

and

protected class Night

{

}

You might be interested in
a client has requested adjustments to the arrangement and placement of elements on an image. what does the client want changed?
qaws [65]

Considering the situation described above, the client wants the <u>image's recipe to be changed.</u>

<h3>What is the Image Recipe?</h3>

Image Recipes are characteristics of an image or picture. It includes features like shape, size, form, pattern, line, shadow, tone, color, contrast, positive space and negative space, etc.

Given that the client needs adjustments to the arrangement and placement of elements on an image, this is a request for a change in the image recipe.

Hence, in this case, it is concluded that the correct answer is "<u>the client wants the recipe of the image changed."</u>

Learn more about the Image Recipe here: brainly.com/question/1605430

6 0
2 years ago
Which technique/concept can be use toimplement multiple inheritances<br> in java?
LiRa [457]

Answer:

Interface

Explanation:

Java does not supports multiple inheritance by class, but we can implement multiple inharitacnce in  java using interface, with interface we uses implements keyword.

Example-

Declare interface like below code -

interface parent{

}

and use in child class like below code -

class Child1 implements interface{

}

class Child2 implements interface{

}

8 0
3 years ago
Thomas would like to know when is the best time of the season to plant his tomato seeds. Which type of informational reference s
kenny6666 [7]

In this question, the options are missing. Here is the complete question:

Thomas would like to know when is the best time of the season to plant his tomato seeds. Which type of informational reference should he use?

A. Encyclopedia

B. Atlas

C. Almanac

D. Any of these

The correct answer is Almanac

Explanation:

Knowing the season or month to plant specific seeds is a relevant factor that can determine whether a plant grows and thrives. Because of this Thomas needs accurate and complete information about the best time of the year to plant tomatoes. This information can be found in an almanac because almanacs include planting dates for different plants as well as weather forecasts and other important events that can affect agriculture. Moreover, this informational reference provides information about the current year, which makes it to be updated in the topics it covers.

4 0
3 years ago
Data warehouse contains historical data obtained from the _____.
STALIN [3.7K]
D. operational databases
3 0
3 years ago
What does the Communications Decency Act of 1996 provide?
Softa [21]

Answer:

a

Explanation:

its the correct becayse

3 0
2 years ago
Other questions:
  • In Alphatech Systems, email software screens incoming messages by organizing them into mailboxes and identifying junk mail. As a
    13·1 answer
  • Wireless attacks avoid the access points to limit detection. <br> a. True <br> b. False
    9·1 answer
  • Swiping up with three fingers on mac os x launches what?
    8·1 answer
  • In python,_______ are used to define the conditions necessary for a while loop to run.
    7·2 answers
  • How many worksheets display in the Excel window when you create a new blank workbook?
    10·2 answers
  • A manager would like information on the knowledge base searches conducted by customers and call center agents. Which two metrics
    10·1 answer
  • Which of the following comments are correct? Select all that apply.
    14·1 answer
  • Who tryna play fortnite?
    5·2 answers
  • Tell the story, step by step, of how your computer finds the CodeHS server,
    9·1 answer
  • Explain impact of modern technology on human life​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!