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
IT ethics are rules, policies, or principles that guide the behavior of IT professionals.
Vadim26 [7]

Answer: true

Explanation: true

6 0
3 years ago
Read the following Selection Sort function and determine the correct answer for blank #2.
lakkis [162]

Answer:

Option(a) is the correct answer to the given fill in the blank of #2

Explanation:

The values[indexOfMin] returns the minimum element in the particular array As in the given question we have to implement the selection sorting .In the selection sorting we have choose the element and compare them others minimum index that's why we have choose the values[indexOfMin] function.

  • The index of min is not the correct function So we have not used in the given fill in the blanks that's why option(b) is incorrect .
  • The  values[startIndex] represent the starting index only that is not suitable for the given question that's why it is incorrect option.

4 0
3 years ago
What function affects the cookies downloaded into the host when playing a video clip?
sukhopar [10]

Answer:

Privacy

Explanation:

7 0
3 years ago
Hat is the simplest way to permanently get rid of an unwanted file
Sholpan [36]
If you have answer choices it’s B.
or
Move said file into the recycle bin and then procced by emoting the recycle bin
8 0
3 years ago
A security engineer is configuring a system that requires the X.509 certificate information to be pasted into a form field in Ba
zavuch27 [327]

Answer:

PFXB

Explanation:

3 0
3 years ago
Other questions:
  • This question involves the implementation of the PasswordGenerator class, which generates strings containing initial passwords f
    5·1 answer
  • A site structure that contains multiple links to individual pages, allowing visitors to go through multiple paths to the site is
    9·1 answer
  • To edit the color of the text in presentation software, choose the Font color command Text Color in the ________ ribbon toolbar.
    15·2 answers
  • What does it mean to read visual and audio text
    7·1 answer
  • How many much memory is in one megabyte ?
    9·1 answer
  • Select the correct answer.
    5·2 answers
  • Write code that uses the input string stream inSS to read input data from string userInput, and updates variables userMonth, use
    8·1 answer
  • Omo help me i need it now.
    12·1 answer
  • Math and science are the foundation from which drafters work<br><br> True<br> False
    8·1 answer
  • What is the difference between computer hardware and computer software?<br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!