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
In an era of widespread cultural change within the United States,
Romashka [77]

In an era of widespread cultural change within the United States, members of the mainstream culture must learn the customs and practices of minority  groups, including new immigrants, and take care to avoid giving offense.  cultural norms of minority groups are so similar to those of the mainstream culture, that  knowing the norms of the majority is sufficient for business success.

Explanation:

  • Acculturation can be defined as the 'process of learning and incorporating the values, beliefs, language, customs and mannerisms of the new country immigrants and their families are living in, including behaviors that affect health such as dietary habits, activity levels and substance use.
  • A cultural misunderstanding occurs when something a word, gesture, object, social context, has different meanings in two cultures.
  • Sometimes the misunderstandings get resolved, sometimes they lead nowhere, and sometimes they can escalate to anything from love to war
  • Ethnic traditions as a sociocultural phenomenon allowing to comprehend the national identity of peoples and universal norms in each culture which make a methodological basis for formation of moral values.
  • But in the 1990s, the term minority usually refers to four major racial and ethnic groups: African Americans, American Indians and Alaska Natives, Asians and Pacific Islanders, and Hispanics.

4 0
4 years ago
Which server-based authentication protocol would be best for an organization that wants to apply authorization policies on a per
BARSIC [14]

Answer:

TACACS+

Explanation:

TACACS+ or terminal access controller access-control system plus is an open standard protocol developed by Cisco. It encrypts all communication in a network ( including the password and data sent) and supports a separate authentication, authorisation and accounting policies for access to a centralised database.

It also uses the transport layer protocol TCP for a reliable data communication.

6 0
4 years ago
Suzanne has inserted an image into her document and would like to adjust the color and contrast of the image.
ch4aika [34]

Answer: I believe it is the second one or third one

Explanation:

8 0
4 years ago
Write the definition of a method printarray, which has one parameter , an array of int s. the method does not return a value . t
stealth61 [152]
<span>void printArray(int a[ ]) {
</span> int i;   <span>for (i = 0; i &lt; a.length; i++){
</span>  <span>System.out.print(a[i]);
</span> System.out.println();   <span>}
</span> }
6 0
4 years ago
Is playing hockey output force or input force?
LUCKY_DIMON [66]

Answer:

Input

Explanation:

got it right on a edunuity test

7 0
3 years ago
Read 2 more answers
Other questions:
  • Groups to which we belong are defined late in our development true or false
    11·1 answer
  • When you divide a picture into thirds, how many parts do you end up with? *
    14·2 answers
  • The class shown below called is called CSVReader. Use this class exactly as it is written (specifically don’t add any instance v
    8·1 answer
  • A typical setup for a ____ network would include computer users sharing a single internet connection.
    15·1 answer
  • A new employee has reported that print jobs are printing as garbled text. Which of the following is MOST likely the reason for t
    8·1 answer
  • 1. The @ symbol is used to denote:​
    7·1 answer
  • Is a tv a
    6·1 answer
  • Software refers to the physical parts of a computer.<br> a. True<br> b. False
    11·2 answers
  • Please help me with these questions please
    15·1 answer
  • What steps can you take to secure your private information?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!