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
Which pair of devices have the same input motion and different outputs?
allochka39001 [22]

Answer:

nutcracker and can opener

Explanation:

5 0
3 years ago
The conventional wisdom concerning the security frameworks of domains is that it is always preferable for an organization to cre
Valentin [98]

Answer:

False

Explanation:

A Domain Based Security. "Domain Based Security", abbreviated to "DBSy", is a model-based approach that is being used in analyzing information security risks in a business context and offers an apparent, understandable and direct mapping among the risks and the security controls needed to handle them.

While A security domain is the list of items a subject is permitted to access. More largely defined, domains are collections of subjects and objects with related security requirements.

6 0
4 years ago
In which of these areas can software engineers specialize?
Elza [17]

Answer:

as me I choose managing user programs.

Explanation:

4 0
3 years ago
Consider tree from the lectures on slide 10, write down the nodes in order as pro-
Leto [7]
The work same to be level order traverse and the sea is completely
7 0
3 years ago
In pre-shared key mode, a passphrase should be at least ________ characters long.
alexandr402 [8]
10.......................................

8 0
3 years ago
Other questions:
  • The network layer of the Internet model uses the _____________ protocol to route messages though the network.
    13·1 answer
  • Using PowerPoint or Impressed guarantees that your presentation will do which of the following?
    6·1 answer
  • Which part(s) of CAIN is realized through the use of message digest functions and hashes?
    14·1 answer
  • The _____ handles the instructions for your computer to start up before the operating system is loaded.
    10·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • Businesses and sometimes individuals use a _____ to assimilate all of their social media content on a specific topic to engage r
    13·1 answer
  • How would you define the term technology
    8·1 answer
  • Which statement best describes the computers all around us
    9·1 answer
  • I need help NOW with my java script!! 1. What will the code below output to the console and why? const person = {
    9·1 answer
  • suppose one packet switches between a sending host and a receiving host. the transmission rates between the sending host and the
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!