Which of the following statements are true:
1, 4
Which of these expressions will return true:
1, 2, 3, 5
True/false: Wrapper objects are always immutable: Integer dataWrapper = new Integer(5);
True
True/false: The following is valid:
unsigned byte b = 0;
False
- There is no unsigned keyword in Java
True/false: The following is valid:
int 2ndArgument = Integer.parseInt(args[2]); //3
False
- an identifier name can’t start with a digit. Note: it may start with an underscore.
Which of these are not part of the StringBuilder class:
1.
Which of the following is not a primitive data value in Java:
1, 4
True/false: Constructors can’t be marked as final
True
True/false: Any class can be declared abstract even if it does not have any abstract method.
True
True/false: Variables cannot be declared synchronized.
True
- Only methods can be declared synchronized.
True/false: Static methods can always refer to non-static/instance members
False.
- (this includes fields and methods).
True/false: An integer can be assigned to a double but not vice versa.
True
True/false: The charAt( ) method can take a char value as an argument.
True
True/false: The charAt( ) method returns a Character object.
False
- it returns char
The following compiles:
class MyString extends String{
MyString(){ super(); }
}False - String is a final class and can't be extended
True/false: the following is valid:
char c = s;
s = c;
False.
- Not all short values are valid char values, and neither are all char values valid short values, Both lines won’t compile.