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
1. A green traffic sign means
NeX [460]

Answer:

general regulatory and speed control.

7 0
3 years ago
Daiki is creating a database for a paint store. Each color of paint would have its own record which will include the color name
egoroff_w [7]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is c)field.

As we know that the feature of an entity is represented by its attribute in the database table. A database table is a set of records of different fields. Each field represents a row in a database table. Each field can contain a set of attributes related to an entity such as a paint color.

So the price of paint will be in its own field. Because there are different colors in the database table. Each color has its own record in form of a field. As you know that each field is a row in the database table. So, each row has the price of a paint color.

Other options are not correct because:

The table contains a list of fields and each field contains its own paint price. The format and file is something different and does not have any relation with the question scenario.

3 0
3 years ago
Read 2 more answers
Some files appear dimmed in one of the default folders on your computer. What would be the best course of action?
Wittaler [7]
It appears that they might be labeled "Hidden" in the properties of that file. Right Click on Properties and Uncheckmark Hidden<span />
7 0
3 years ago
BIOS has two jobs. One is to boot up, or start, the computer. What is the other? Maintain the computer’s software firewall. Ensu
Levart [38]

Answer:

Provide the basic interface for the hardware.

Explanation:

3 0
3 years ago
Program _______ graphically present the detailed sequence of steps needed to solve a programming problem.
AlekseyPX

Program Pseudocode graphically present the detailed sequence of steps needed to solve a programming problem.

<h3>What are Pseudocode?</h3>

These are known to be a set of codes that a program has graphically depicted all of its sequence of steps that can be sued to handle a programming problem.

Note that Pseudocode is a form of artificial and man made informal language that is often used by programmers to create  algorithms.

Learn more about Program from

brainly.com/question/153827

#SPJ1

3 0
2 years ago
Other questions:
  • Write a function max arguments. write a program that reads three floating-point numbers, uses the max function, and displays the
    5·1 answer
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • You have just changed the system time within your computer's BIOS. You choose to save the settings upon exit. What happens next
    14·2 answers
  • Consider a channel that can lose packets but has a maximum delay that is known. Modify Protocol rdt2.1 to include sender timeout
    11·1 answer
  • Describe how electrons move between atoms to create electricity.
    7·2 answers
  • To copy both character attributes and paragraph attributes, such as alignment and indentation, select the entire paragraph. TRUE
    14·1 answer
  • Is there any quantum computer in India?​
    9·1 answer
  • Python Coding:
    15·1 answer
  • SmartArt is a Microsoft Office tool for creating what?
    11·2 answers
  • A vlan ________.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!