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
bearhunter [10]
3 years ago
15

Where might the Null Object pattern be useful?

Computers and Technology
1 answer:
Tanzania [10]3 years ago
5 0

Answer:  Null Object pattern be useful when the absence of an object can be encapsulated by other alternatives which does not have any have any effect.

Explanation:

public interface Rectangle {

double area();

   double surfaceare();

   boolean isNull();

}

In the code above we have a function for null object. So in the absence of an object we have encapsulated with a method of null which does not do anything. It simplifies the use of dependencies that can be undefined.

In case of collaborator the NULL object pattern makes use of the existing collaboration instead of defining a new one.

It also enable to abstract the handling of null objects from the client so that internal details of the program are not know to outsiders.

You might be interested in
Write an application that determines whether the first two files are located in the same folder as the third one. The program sh
marissa [1.9K]

Answer:

The program in Python is as follows:

fname1 = input("Filepath 1: ").lower()

fname2 = input("Filepath 2: ").lower()

fname3 = input("Filepath 3: ").lower()

f1dir = ""; f2dir = ""; f3dir = ""

fnamesplit = fname1.split("/")

for i in range(len(fnamesplit)-1):

   f1dir+=fnamesplit[i]+"/"

fnamesplit = fname2.split("/")

for i in range(len(fnamesplit)-1):

   f2dir+=fnamesplit[i]+"/"

fnamesplit = fname3.split("/")

for i in range(len(fnamesplit)-1):

   f3dir+=fnamesplit[i]+"/"

if f1dir == f2dir == f3dir:

   print("Files are in the same folder")

else:

   print("Files are in the different folder")

Explanation:

The next three lines get the file path of the three files

<em>fname1 = input("Filepath 1: ").lower()</em>

<em>fname2 = input("Filepath 2: ").lower()</em>

<em>fname3 = input("Filepath 3: ").lower()</em>

This initializes the directory of the three files to an empty string

f1dir = ""; f2dir = ""; f3dir = ""

This splits file name 1 by "/"

fnamesplit = fname1.split("/")

This iteration gets the directory of file 1 (leaving out the file name)

<em>for i in range(len(fnamesplit)-1):</em>

<em>    f1dir+=fnamesplit[i]+"/"</em>

This splits file name 2 by "/"

fnamesplit = fname2.split("/")

This iteration gets the directory of file 2 (leaving out the file name)

<em>for i in range(len(fnamesplit)-1):</em>

<em>    f2dir+=fnamesplit[i]+"/"</em>

This splits file name 3 by "/"

fnamesplit = fname3.split("/")

This iteration gets the directory of file 3 (leaving out the file name)

<em>for i in range(len(fnamesplit)-1):</em>

<em>    f3dir+=fnamesplit[i]+"/"</em>

This checks if the file directories hold the same value

This is executed, if yes

<em>if f1dir == f2dir == f3dir:</em>

<em>    print("Files are in the same folder")</em>

This is executed, if otherwise

<em>else:</em>

<em>    print("Files are in the different folder")</em>

5 0
3 years ago
The process of changing data from their original form to a format that more closely fits the research objectives of the research
lys-0071 [83]

ANSWER- True


Data transformation is defined as the process of converting data or information from one format to another. Usually, the data or information is changed from the original format (The format of a source system) into the required format of a new destination system; a format that fits the objectives of the research/study.

8 0
3 years ago
Phoebe has to give a presentation about recycling. Where should she look while presenting?
Naddika [18.5K]
Well, I think that maybe the answer is B or C. She shouldn't only look at her presentation while she is presenting it, that doesn't look professional, and you want to look at the people you are talking to.
6 0
3 years ago
Read 2 more answers
Which of the following scenarios describes an IT
slava [35]

Answer:

-checking social media networks during working hours

-surfing the Internet during working hours for what to do on the weekend

-downloading a favorite band’s latest album from a file-sharing service

Explanation:

they are all correct on edg.

8 0
3 years ago
Read 2 more answers
NEEDED ASAP
kogti [31]

Explanation:

1. special key combination that causes specific commands to be executed typically shortcut keys combine the ctrl or alt keys with some other keys.

2. 5 example of shortcut keys are:-

  • 1. ctrl + A - select all
  • 2.ctrl + B - bold
  • 3. ctrl + C - copy
  • 4. ctrl + U - under line
  • 5. ctrl + v - paste

3. (i) open the start menu

(ii) open Windows task manager

(iii) close the currently active program

(iv) replace

(v) align center

4. the three importance of shortcut keys are :

  • efficient and time saving :- using shortcut make you more efficient at doing certain task on your computer .
  • multi-tasking :- being a multi Tasker is something required in life.
  • health benefit :- cutting down on your mouse usage by using keyboard shortcut can help reduce the risk of RSI (Repetitive Syndrome Injury).

5. shortcut keys are very helpful because it take less time. keyboard shortcuts are generally used to expedite common operation by reducing input sequence to a few keystrokes.

8 0
2 years ago
Other questions:
  • In the u.s.all financial institutions are required to conduct business at a physical location only
    9·1 answer
  • What is primary storage
    11·2 answers
  • Utility software is also known as _____​
    11·1 answer
  • At what x position are the ellipses drawn??? thanks ♡​
    6·1 answer
  • I want to get an output picture in python but it says this. I'm using turtle
    12·1 answer
  • Question 1 (3 points)
    6·2 answers
  • Two technicians are discussing Newton's first law of motion. Technician A says that a lightweight vehicle requires as
    8·1 answer
  • Please help me with these questions​
    12·2 answers
  • When solving a problem in a group situation, which of the following traits should be demonstrated?
    8·1 answer
  • Q1) write a brief note on desktop computer.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!