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...
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.
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. 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
Question 1 Which statement is false about what Data Types defines Question 1 options: What values...
Question 1 Which statement is false about what Data Types defines Question 1 options: What values a variable cannot hold? How much memory will be reserved for the variable? What value a variable will hold? How the program will use the data type? Question 2 Using the structure below, which of the following statements about creating an array (size 20) of structures are not true? struct Employee{     string emp_id;     string emp_name;     string emp_sex; }; Question 2 options:...
1.Production planning and control is part of which transaction cycle? Select one: a. Revenue cycle b....
1.Production planning and control is part of which transaction cycle? Select one: a. Revenue cycle b. Expenditure cycle c. Profit cycle     d. Conversion cycle 2.All the following are examples of database backup controls except: Select one: a. Database authorization table b. Transaction log c. Checkpoint d. Recovery module 3.During transaction processing, we may need to access a list of customers who have been granted specific discounts to ensure we apply the correct rates. Such information can be found in:...
Design a class with the following requirements: 1- give the class a name from your choice....
Design a class with the following requirements: 1- give the class a name from your choice. 2- write some code that creates three instance variables, choose a name and type for each one of them. (must have two private and one public variables) 3- Initialize the variables using two different constructors. 4- Use mutator and accessor methods (set and get) for the private data members. 5- Display the value of each member variable using a method. 6- In the main,...
Cpp Task: Create a class called Mixed. Objects of type Mixed will store and manage rational...
Cpp Task: Create a class called Mixed. Objects of type Mixed will store and manage rational numbers in a mixed number format (integer part and a fraction part). Details and Requirements Your class must allow for storage of rational numbers in a mixed number format. Remember that a mixed number consists of an integer part and a fraction part (like 3 1/2 – “three and one-half”). The Mixed class must allow for both positive and negative mixed number values. A...
Write a program in Java that: 1. will prompt user with a menu that contains options...
Write a program in Java that: 1. will prompt user with a menu that contains options to: a. Add a To-Do Item to a todo list. A To-Do Item contains: i. An arbitrary reference number (4; 44,004; etc.) ii. A text description of the item ("Pick up dry cleaning", etc.) iii. A priority level (1, 2, 3, 4, or 5) b. View an item in the list (based on its reference number) c. Delete an item from the list (based...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT