The Exam editor's note on this option is:Long.longValue(mStr);
My question is what prevents us from using a non- static methodlongValue is a non-static method in Long class.
in this context?
Moderator: admin
The Exam editor's note on this option is:Long.longValue(mStr);
My question is what prevents us from using a non- static methodlongValue is a non-static method in Long class.
Code: Select all
public static Integer valueOf(int i) {
if (i >= IntegerCache.low && i <= IntegerCache.high)
return IntegerCache.cache[i + (-IntegerCache.low)];
return new Integer(i);
}
why it's not correct in this question?Long.longValue(mStr);
I've tried to compile that code and it's runned without any problem.Given:
String mStr = "123";
long m = // 1
Which of the following options when put at //1 will assign 123 to m?
Users browsing this forum: No registered users and 49 guests