Computer Science: Programming with a Purpose Week 8 Quiz Answer
In this article i am gone to share Coursera Course Computer
Science: Programming with a Purpose Week 8 | Abstract Data Types
Quiz Answer with you..
Abstract Data Types
Question 1)
What is an object?
- A variable name
- Something that holds a data type value
- A data type whose representation is hidden
- A data type
- A data type value
Question 2)
Which of the following do you need to know in order to use a data type
in Java? Mark all that apply.
- Its name
- How to create new objects
- How to destroy objects
- How objects are represented
- How to apply operations to an object
Question 3)
What does the following code fragment print?
String string1 = "hello";
String string2 = string1;
string1 = "world";
Stdout.println(string1 + string2);
- worldhello
- hellohello
- helloworld
- worldworld
Question 4)
Consider the following code fragment:
String t = example.substring(5, 8);
Which of the following are true after this code is executed? Mark all
that apply.
- (s.length() == t.length() is true
- s and t refer to the same data-type value
- (s == t) is false
- s and t refer to different strings
- (s.equals(t)) is true
_________________________________________________________________________
0 Comments