Pritha Banerjee

Greenhorn
+ Follow
since Mar 24, 2015
Pritha likes ...
Oracle Tomcat Server
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
6
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pritha Banerjee

I passed the OCPJP7 exam with 81% last week. What should I do next? Suggestions are welcome.
7 years ago


Output: 000000
The doVIP() method is called thrice so the output should be 000. What am I missing out here?
'For "%b" : If the argument arg is null, then the result is "false". If arg is a boolean or Boolean, then the result is the string returned by String.valueOf(). Otherwise, the result is "true".' I got it, thanks Piet
Given the following code fragment:


For any non null argument, %b returns true. So in line 6 we get true. However in line 7 'format("%b",new Boolean(b)).toString();' returns false. Please explain.
Hi Henry,

So does instanceof check the reference type rather than the actual object in it?
In that case if I execute this piece of code, it should return false but it gives a compilation error.



vararg.java:6: error: inconvertible types
System.out.print(s instanceof StringBuilder);
^
required: StringBuilder
found: String
1 error

Moreover if I cast a String to Stringbuilder it would not compile because they are not in the same hierarchy.
That is not my question. If d contains an instance of String then

should result in a compilation error. Please correct me if I am wrong.


In lines 1 and 2, d and e both contain Strings. String and StringBuilder do not belong to the same class hierarchy so these lines should result in compilation error.


The answer is "sub 1 2".

I took seven enthuware mock tests and my scores are as follows:
Test-1 = 83%
Test-2 to Test-6 = 71%
Test-7 = 72%
Test-8 = 77%
Am I ready for the final exam??
I have'nt yet taken the unique test. Any suggestions are welcome.
Consider the following code:

Further, given that the following are the contents of STUDENT, ENROLLMENT, TEACHER tables, what will jrs contain?

STUDENT
SIDNAME
1amy
2bob
3Cathy


ENROLLMENT
SIDSUBJECT
1maths
2science

TEACHER
TIDNAMESUBJECT
11Mr. PeterMaths
12Mr. ChanScience


Answer: jrs will be empty.