Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Abdi Duale

+ Follow
since Dec 13, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abdi Duale

I am convinced that the answer is B. A is false because the class is not encapsulated as the members and the class are left public. C putting those two lines in a block won't encapsulate, I don't see how it would. D, once the radius is set, the diameter is obvious from the formula.

Best of luck!
Good idea. But how do we get started? May be we should set a target and work towards it. Say, finish K&B to certain chapter. This might bore some people but at least we would be at the same pace and tackle questions of the same scope, after all it is a group study.


Employer [] emp = new Employer[2]
emp[0] =new Employer("Tim");

Try using a for loop i.e

for(int i =0; i<emp.length; i++)
System.out.print(" "+emp[i]);
15 years ago
Thanks a lot for the tip Jay.
Appreciate it.
Yes I got it.

Thanks a lot Naresh. appreciate it
K&B page 175.
class Bitwise{
public static void main(String[] args){
int x =5;
System.out.println("x is initially "+x);
x = ~x;
System.out.println("~x is equal to "+x);
x is initially 5
~x is equal to -6

could anyone explain why it is printing -6?

appreciate it,
Interesting question. So, when say instanceof operator is used to check whether an object is of a particular type what exactly are we checking in order to determine their relationship? Are we checking if they have the same methods, members etc or what?
For instance, in the above example if H was a subclass of G, the test would return true right? because H would have some commonalities of G such as non-private methods, non-private class variable ( basically is would pass the IS-A test). what exactly does intanceof check?