Page 2OOM ot 5 much time on a single problem. Please write precise and clean ans
ID: 3722766 • Letter: P
Question
Page 2OOM ot 5 much time on a single problem. Please write precise and clean answers. 1. True/False questions Statement True False 1) The expression "Java"1 23 evaluates to Java 6 2) Class B inherits from Class A, B has access to members of A 3) An Abstract Data Type (ADT) must obviously have some kind of representation for its data. We often make this presentation public so that a user can change it to improve our codin 4) In Java, we pass parameters to methods as references. 5) Class and object are just different names for the same thin 6) The following code is an example of instantiating a String object: String str String( "Hello" 7) The following code if (condition) do A; do B; do BC; else do A; do D; do DC;) can be optimized with do BC; do DC; if (condition) do A; do B; else do A; do D; 8) The different versions of an overloaded method are differentiated by their signatures (types) 9) An advantage of arrays compared to linked lists is that it takes fewer steps to insert a new element at the beginning of a long array than at the beginning of a long linked list 10) Consider the statement "X = (a > b) ? a : b", then the value of x is 27, if a = 18 and b-27Explanation / Answer
1) False
2) False (has access to only non private members)
3) False (data in ADT must stay private)
4) True (Objects are passed to methods as references. whereas primitive types such as int, char, etc.. cannot be passed by reference. Answer can be false if primitives are included in question)
5) False (They are two different things in java)
6) False (Needs a new. String str = new String("Hello"))
7) False
8) True (Differentiated by number of parameters and types of parameters)
9) False
10) True
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.