1. True/False questions Statement True False 1) The expression \"Java\"+12 3 eva
ID: 3724007 • Letter: 1
Question
1. True/False questions Statement True False 1) The expression "Java"+12 3 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 coding 4) In Java, we pass parameters to methods as references 5) Class and object are just different names for the same thing 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; h else do A; do D; do DC; can be optimized with: do BC; do DC; if (condition) do A; do B; 1 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 27.Explanation / 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.