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
Create a program in Matlab that prints the numbers from 1-100.
Burka [1]

Answer:

numbers = 1:1:100;

for num=numbers

remainder3 = rem(num,3);

remainder5 = rem(num,5);

 

if remainder3==0

disp("Yee")

else

if remainder3 == 0 && remainder5 == 0

disp ("Yee-Haw")

else

if remainder5==0

disp("Haw")

else

disp("Not a multiple of 5 or 4")

end

end

end  

end

Explanation:

  • Initialize the numbers variable from 1 to 100.
  • Loop through the all the numbers and find their remainders.
  • Check if a number is multiple of 5, 3 or both and display the message accordingly.
4 0
4 years ago
A DSS8440 server is equipped with one power supply that is failing and requires replacement. What is the correct sequence of ste
Alisiya [41]

Answer:

ICICI oxidized sicken o'clock o'clock succinct

6 0
2 years ago
True or False: Busy people prefer your email as one big paragraph rather than adding line breaks for new sections/paragraphs. Yo
Rainbow [258]

Based on the information given regarding how email should be written, it can be deduced that the statement is false.

<h3>Importance of emails.</h3>

It should be noted that email is an important method that is used for communication. It's fast, cheap, and easily accessible.

People do not prefer your email as one big paragraph rather, it's important to add line breaks for new sections or paragraphs. This is essential to convey the information effectively.

In conclusion, using email us also beneficial for businesses to reach their customers.

Learn more about emails on:

brainly.com/question/24558412

3 0
3 years ago
30 POINTS!!
Snowcat [4.5K]

Answer:

paragraph or by a break line space

5 0
3 years ago
You can apply the Bold font style by pressing the ____ keyboard shortcut keys.
Free_Kalibri [48]
CTRL+B when you hover your mouse over it on powerpoint it comes up saying that
8 0
3 years ago
Read 2 more answers
Other questions:
  • Persons who have been given access to an installation can be counted on to be of no threat. true or false? (antiterrorism scenar
    13·1 answer
  • Type the correct answer in the box. Spell the word correctly. What aspect should you consider before adding pictures to a docume
    7·2 answers
  • : How does the founder of Wikipedia keep a tight reign on accuracy? HELP PLEZ AT LEAST A PARGRAPH PLES
    6·1 answer
  • Write a code to define a structure named student, which includes name, student number and email address
    5·1 answer
  • Help me to write spaghetti stack function, please!!
    11·1 answer
  • 6. The following is a dump of a DATA chunk in hexadecimal format. 00000015 00000005 0003000A 00000000 48656C6C 6F000000 a. Is th
    7·1 answer
  • What is the output of the following code segment?
    11·1 answer
  • Convert<br> 0.625 to binary
    6·1 answer
  • Do network packets take the shortest route?
    14·2 answers
  • Between the div tags below, type the code for a link to the second.html page. Use "Go to the Second Page" as the link text
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!