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]
2 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]2 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
The latest form of personal communication that most resembles a public journal is a _____.
Airida [17]
The answer is b becuase a daily blog is a daily journal
8 0
2 years ago
Read 2 more answers
When a visitor clicks the submit button on a form, the ______ of each form element is sent?
Bond [772]

In data presentation of computing systems and applications, when a user click the submit button on the form, the name-value pair of each form is sent because it is an open-ended data structure that allows future extension without altering existing code or data.

6 0
3 years ago
Read 2 more answers
Carlie was asked to review a software project for her company to determine specific deadlines. Which part of project management
Elis [28]

Answer:

Resources

Explanation:

Carlie certainly requires to review the resources. It is important to find out how many software engineers, testers, etc. are available. And only then Carlie can find out the exact deadlines as required here. And hence, she must have look at the resources while determining the specific deadlines. Hence, resources are the correct option.

3 0
3 years ago
Read 2 more answers
WHAT DOES THE TRANSPORT LAYER USE TO MAKE SURE THAT A MESSAGE IS REASSWMBLED CORRECTLY ON THE RECEIVING DEVICES?
mrs_skeptik [129]
The answer is  sequence  number
6 0
3 years ago
Explain the concept of an engineering trade-offs and give an example
makvit [3.9K]

ytfjkhm,MNbkvjhmb,kn.l">

k

8 0
3 years ago
Read 2 more answers
Other questions:
  • Can you give me a free neon legendary pet in Adopt Me on Roblox!!!​ my user is: IamNathan215
    15·2 answers
  • When looking at an object or process to code, it is important to think of as general a solution as possible and consider all the
    13·1 answer
  • Select all that apply. Hyperlinks can appear as: words pictures symbols trademarks
    12·2 answers
  • Use the image above to determine which toolbars will be displayed in the program you are using. SELECT ALL THAT APPLY
    11·2 answers
  • This question is for one of my classes I am in right now, and the question is:
    8·1 answer
  • Does the brain play a role in smartphone addiction
    7·2 answers
  • Instructions
    8·1 answer
  • Match the elements of a web page with their descriptions.
    12·1 answer
  • I need help!! I decided to go back to college this year and am taking Intro to Logic and Programming. I have an assignment due t
    5·1 answer
  • Which of the following are true about algorithms? (You may select more than one)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!