Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is Java Programing Question 1: Multiple Choice Questions (24 pointa): .01) .02) .03) What is abstraction? a) The ability to focus on a problem

This is Java Programing
image text in transcribed
image text in transcribed
Question 1: Multiple Choice Questions (24 pointa): .01) .02) .03) What is abstraction? a) The ability to focus on a problem at a high level without worrying about the minor details b) When things are confusing and vague rather than simple and understandable. A Java keyword that optimizes programs that do not use classes or objects. d) The opposite of addition, as seen in mathematics. How do objects provide abstraction? a) By giving us more powerful pieces of data that have sophisticated behavior without having to manage and manipulate the data directly. b) Objects provide abstraction when they declare a lot of useful data inside them. Public fields provide abstraction because they let the client directly view an object's data d) When one object converts into another type of object, it becomes abstract. e) Objects provide abstraction through the .provideAbstraction() method. How does encapsulation allow you to change the internal implementation of a class? a) When a class is encapsulated clients cannot directly access its fields, so changing those fields will not disturb client behavior as long as the external view (method behavior) is consistent. b) Encapsulation allows you to add more fields and methods to the class later, changing its implementation. The client can call the change InternalImplementation() method to accomplish this. d) Encapsulation makes the entire class private so that you can change anything in the class in any way you want. e) Encapsulation does not help with changing implementations. The class must be rewritten from scratch. When fields are made private, client programs cannot see them directly. How do you allow classes access to read these fields' values, without letting the client break the object's encapsulation? a) Create an accessor method that returns the field's value. .04) TACOMA b) Create another class with the same field, but make it public. Then the two classes can both see the private field. c) You must change it to be public, then re-compile the program. d) You have to also declare the field with the 'friend' keyword for another class to access it. e) It is a trick question; private fields' cannot ever be accessed. That is the point of making them private

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions