Consider the following code fragment when answering questions 1-4 int x; String
ID: 3859213 • Letter: C
Question
Consider the following code fragment when answering questions 1-4
int x;
String s;
Keyboard k;
x = 15;
s = “abcdefg”;
k = new Keyboard( );
1. In the above code, s is considered to be
a) illegal
b) a class
c) an object
d) uninitialized
2. In the above code, x is considered to be
a) a variable
b) a class
c) illegal
d) uninitialized
3. In the above code, Keyboard is considered to be
a) uninitialized
b) a class
c) a method
d) a variable
4. In the above code, “abcdefg” is considered to be
a) a word
b) a phrase
c) a String value
d) misspelled
Explanation / Answer
1. In the above code, s is considered to be
d) uninitialized
Where s is declared but not assigned
2. In the above code, x is considered to be
a) a variable
3. In the above code, Keyboard is considered to be
b) a class
4. In the above code, “abcdefg” is considered to be
c) a String value
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.