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
lys-0071 [83]
2 years ago
14

In a shallow copy, ____. the values of two or more pointers are copied into a list two or more pointers of the same type point t

o the same memory location two or more pointers of differing types point to the same memory location two or more pointers of the same type point to different memory locations
Computers and Technology
2 answers:
strojnjashka [21]2 years ago
8 0

Answer:

Explanation:

A Shallow copy is a bit-wise (unit of data) copy of an object that can be found/used in an object-oriented programming language code, the copy contains all of the same exact values that exist within the original object. In a shallow copy, two or more pointers of the same type point to the same memory location.

Misha Larkins [42]2 years ago
3 0

Answer:

two or more pointers of the same type point to the same memory

Explanation:

A shallow copy is a bit wise copy of another object. in this practice a new exact copy of an original object is created also if any of the fields of the original object is referenced to another object, while creating the shallow copy only the memory address of that field is copied.

A shallow copy is used in object oriented programming languages like C++, Java, python, SQL  .................... etc A shallow copy is very efficient because it helps to create copies of already created objects instead of having to create new objects everything .

You might be interested in
Write a recursive method called lengthOfLongestSubsequence(a, b) that calculates the length of the longest common subsequence (l
kompoz [17]

Answer:

Explanation:

The following code is written in Java and creates the recursive function to find the longest common substring as requested.

 static int lengthOfLongestSubsequence(String X, String Y) {

       int m = X.length();

       int n = Y.length();

       if (m == 0 || n == 0) {

           return 0;

       }

       if (X.charAt(m - 1) == Y.charAt(n - 1)) {

           return 1 + lengthOfLongestSubsequence(X, Y);

       } else {

           return Math.max(lengthOfLongestSubsequence(X, Y),

                   lengthOfLongestSubsequence(X, Y));

       }

   }

4 0
3 years ago
Write a telephone lookup program. Read a data set of 1,000 names and telephone numbers from a file that contains the numbers in
morpeh [17]

Answer:

See explaination

Explanation:

PhoneLookup.java

import java.io.FileReader;

import java.io.IOException;

import java.util.Scanner;

public class PhoneLookup

{

public static void main(String[] args) throws IOException

{

Scanner in = new Scanner(System.in);

System.out.println("Enter the name of the phonebook file: ");

String fileName = in.nextLine();

LookupTable table = new LookupTable();

FileReader reader = new FileReader(fileName);

table.read(new Scanner(reader));

boolean more = true;

while (more)

{

System.out.println("Lookup N)ame, P)hone number, Q)uit?");

String cmd = in.nextLine();

if (cmd.equalsIgnoreCase("Q"))

more = false;

else if (cmd.equalsIgnoreCase("N"))

{

System.out.println("Enter name:");

String n = in.nextLine();

System.out.println("Phone number: " + table.lookup(n));

}

else if (cmd.equalsIgnoreCase("P"))

{

System.out.println("Enter phone number:");

String n = in.nextLine();

System.out.println("Name: " + table.reverseLookup(n));

}

}

}

}

LookupTable.java

import java.util.ArrayList;

import java.util.Collections;

import java.util.Scanner;

/**

A table for lookups and reverse lookups

*/

public class LookupTable

{

private ArrayList<Item> people;

/**

Constructs a LookupTable object.

*/

public LookupTable()

{

people = new ArrayList<Item>();

}

/**

Reads key/value pairs.

atparam in the scanner for reading the input

*/

public void read(Scanner in)

{

while(in.hasNext()){

String name = in.nextLine();

String number = in.nextLine();

people.add(new Item(name, number));

}

}

/**

Looks up an item in the table.

atparam k the key to find

atreturn the value with the given key, or null if no

such item was found.

*/

public String lookup(String k)

{

String output = null;

for(Item item: people){

if(k.equals(item.getName())){

output = item.getNumber();

}

}

return output;

}

/**

Looks up an item in the table.

atparam v the value to find

atreturn the key with the given value, or null if no

such item was found.

*/

public String reverseLookup(String v)

{

String output = null;

for(Item item: people){

if(v.equals(item.getNumber())){

output = item.getName();

}

}

return output;

}

}

Item.java

public class Item {

private String name, number;

public Item(String aName, String aNumber){

name = aName;

number = aNumber;

}

public String getName(){

return name;

}

public String getNumber(){

return number;

}

}

input.txt

Abbott, Amy

408-924-1669

Abeyta, Ric

408-924-2185

Abrams, Arthur

408-924-6120

Abriam-Yago, Kathy

408-924-3159

Accardo, Dan

408-924-2236

Acevedo, Elvira

408-924-5200

Acevedo, Gloria

408-924-6556

Achtenhagen, Stephen

408-924-3522

Note: Replace all the "at" with at symbol

4 0
3 years ago
window operating system popularly known as. 1) character user interface. 2) computer user interface. 3) graphic user interface.
fredd [130]

Answer:

The window operating system is popularly known as a graphical user interface(GUI)

Explanation:

older operating systems were command line based but window uses a gui

5 0
3 years ago
Which of the following blocks is least similar to the others?
GuDViN [60]
The answer is A or B
4 0
3 years ago
Read 2 more answers
You want to find the distance between two points.
maks197457 [2]

Answer:

For the first picture, choose the second pair, and for the second one, choose the first pair

Explanation:

5 0
3 years ago
Other questions:
  • Molly wants to make some cells in her balance spreadsheet different colors so that she can more quickly find important data. Wha
    13·2 answers
  • Isaac is researching Abraham Lincoln’s life for a social studies report. He finds an encyclopedia that includes original letters
    5·2 answers
  • What is the slogan of the sociological school of criticism ?​
    9·1 answer
  • Rita wants to know the size of each image in a folder. Which view will help her find this information quickly?
    7·1 answer
  • What is the name of the option in most presentation applications with which you can modify slide elements? The ( answer here )op
    9·1 answer
  • Which of the following is true about radio waves? They have short wavelengths. They have high energies. They reveal hot gases. T
    10·2 answers
  • Which are two main areas of the properties inspector
    7·1 answer
  • What is the approximate boiling point
    7·1 answer
  • The IBM nine-track tapes that became the industry standard for storage for three decades had several sizes , the most common bei
    13·1 answer
  • Blender is used by which video game team member?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!