Question

Which one of the following situations does NOT have a retain cycle? Object 1 of struct...

  1. Which one of the following situations does NOT have a retain cycle?
  1. Object 1 of struct A is assigned to a member of Object 2 of struct B, while Object 2 of struct B is assigned to a member of Object 1 of struct A.
  2. Object 1 of class A is assigned to a member of Object 2 of class A, while Object 2 of class A is assigned to a member of Object 1 of class A.
  3. Object 1 of class A is assigned to a member of Object 2 of struct B, while Object 2 of struct B is assigned to a member of Object 1 of class A.
  4. Object 1 of class A is assigned to a member of Object 2 of class B, while Object 2 of class B is assigned to a member of Object 1 of class A.
  1. Which of the followings are the potential consequences of memory leak? Select all that apply.
  1. The program keeps consuming memory.
  2. The program tries to read data from the memory space of another program.
  3. The program tries to write data to the memory space of another program.
  4. Some garbage values remain in the memory, but they cannot be released.
  1. Which of the followings does NOT resolve a retain cycle?
  1. Use unowned reference.
  2. Use weak reference
  3. Use struct instead of class.
  4. Implement deinitializers

  1. What can we do with function types? Select all that apply.
  1. Use function type to declare a variable
  2. Pass a parameter of a function type to a function.
  3. Return a data of a function type from a function.
  4. Use function type to declare a property of a class.

Homework Answers

Answer #1

Aneswer the above Questions

  1. Which one of the following situations does NOT have a retain cycle?
    1. Object 1 of class A is assigned to a member of Object 2 of class B, while Object 2 of class B is assigned to a member of Object 1 of class A.
  2. Which of the followings are the potential consequences of memory leak? Select all that apply.
    1. The program keeps consuming memory.
    2. The program tries to read data from the memory space of another program.
    3. The program tries to write data to the memory space of another program
  3.   Which of the followings does NOT resolve a retain cycle?
    1. Use weak reference
  4. What can we do with function types? Select all that apply.
    1. Pass a parameter of a function type to a function.
    2. Return a data of a function type from a function
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
no need to explain. True or False 1. A constructor is a special Class member method....
no need to explain. True or False 1. A constructor is a special Class member method. It is automatically called when an object of the class is created. It can also be called more than once after the object is created. 2. In Java, the new operator is used to create an instance/object of a class in the heap. 3. A reference variable is a memory location contains an address of an object stored in the stack. 4. Encapsulation and...
30. Suppose sum and num are int variables, and the input is 15 18 20 -1...
30. Suppose sum and num are int variables, and the input is 15 18 20 -1 What is the output of the following code? (Assume that console is a scanner object initialized to the standard input device.) sum = console.nextInt(); num = console.nextInt(); while (num != -1) { num = console.nextInt(); sum = sum + num; } System.out.println(sum); a. 34 b.35 c.52 d.53 57. Which of the following statements would you use to declare the reference variable secretObject of type...
1.Write a c++ program to find Maximum out of two numbers using friend function. Here one...
1.Write a c++ program to find Maximum out of two numbers using friend function. Here one member is of one class and second belongs to another class. 2.Write a c++ program to swap the values of private data members of classes names classOne and classTwo using friend keyword.
chose the best definition for Class a. an object definition, containing the data function elements necessary...
chose the best definition for Class a. an object definition, containing the data function elements necessary create an object b. an action in a program c. a group of people d. program execution --------------------------- Choose the best definition of java script a. a file on disk b. An instance of a class c. method class d. native data types --------------------------------- Choose the appropriate data type for this value: true a.double b.string c.Boolean d.int -------------------- Choose the appropriate data type for...
Lab Objectives This lab was designed to inforce the following programming concepts: • Using classes to...
Lab Objectives This lab was designed to inforce the following programming concepts: • Using classes to create a data type SimpleCalculator capable of performing arithmetic operations. • Creating const member functions to enforce the principle of least privilege. The follow-up questions and activities also will give you practice: • Using constructors to specify initial values for data members of a programmer-defined class. Description of the Problem Write a SimpleCalculator class that has public methods for adding, subtracting, multiplying and dividing...
In C++ Employee Class Write a class named Employee (see definition below), create an array of...
In C++ Employee Class Write a class named Employee (see definition below), create an array of Employee objects, and process the array using three functions. In main create an array of 100 Employee objects using the default constructor. The program will repeatedly execute four menu items selected by the user, in main: 1) in a function, store in the array of Employee objects the user-entered data shown below (but program to allow an unknown number of objects to be stored,...
1.Make a class whose objects each represent a battery. The only attribute an object will have...
1.Make a class whose objects each represent a battery. The only attribute an object will have is the battery type (one letter). Also, the class has to include the following services for its objects: determine if two batteries are equal change battery type get battery type display battery information 2.Make a class whose objects each represent a box of batteries (use dynamic memory and draw the class diagram). Also, the class has to include the following services for its objects:...
1. Which of the following functions in R can be used to inspect data object? Select...
1. Which of the following functions in R can be used to inspect data object? Select all that apply. rm glimpse() head() plot 2. To get an overview of your data, one can use the function: ls() args() summary() list() 5. Numerical summaries/characteristics of the population are called parameters. True False
1. Which one of the following is not a component of a layer? A geometric object...
1. Which one of the following is not a component of a layer? A geometric object (geom) Aesthetic mappings (aes) A position adjustment (position) A statistical transformation (stat) Date 2. A plot is: A set of layers A set of scales A coordinate system A facetting specification True False 3. Which is not true about geospatial data? Data containd longitude, latitude describes locations on the surface of the Earth Data is associated with locations Data contains location described by coordinates...
You need to write a permute class that will take first and second strings to rearrange...
You need to write a permute class that will take first and second strings to rearrange letters in first, followed by second. For example, if the first is “CAT” string and second is “MAN” string, then the program would print the strings TACMAN, ATCMAN, CTAMAN, TCAMAN, ACTMAN, and CATMAN. The first and second strings can be any length of string or a null. The permute class uses a Node class as link list node to link all letters arrangement. The...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT