rushikesh sawant

Ranch Hand
+ Follow
since Dec 22, 2009
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 rushikesh sawant

method with var-arg is selected only if there is no other valid overload. You should read method overloading section.
ujjawal, your method definition says that it can accept Number type or its super types only.

but the list you are passing to that method says that it can accept Number type or its any of its subtypes also. So as generic is compile time protection compiler cannot make sure that you will pass only Number type to that method, hence compiler error.
Wrappers are peers to each other. They cannot be converted from one type to other.
programming using OOP concepts makes life easier for software people. Its easy to debug, test, and most importantly it provides component reuse which is essential for faster development and to cope with changing requirements in software development.
hey sorry, problem resolved. my mistake
i mixed it with -d and and class got placed again one level lower in directory tree.
got confused because of many files there
Thanks for reply.
yea, i did include package statement...
The following question is from K&B's self test, chapter 10:

Given the default classpath:
And this directory structure:

And these two files:

it asks for the right comman to compile

right answer is:
Set the current directory to test then invoke
javac -classpath . xcom/

when i tried this example, it is not working.
it is working with, -classpath xcom xcom/
Am i getting this wrong?
um, what about second one? why 0? i think 3.
hey ankit i think in last one, 1 object should be eligible for gc. is it right?
oh got it.
1) 10 objects eligible for gc, variable "obj" is block scoped.
2) 0 objects eligible for gc.
3) 0 objects.
4) 0 object eligible for gc, wrappers are immutable.

i think these are the answers.
thanks for reply.
so does it mean that elements in PriorityQueue are not stored in a sorted manner of any kind? and its just the order in which they get removed is determined by either the natural order or by a comparator.
it took 15 days...
i think it will be good if you start reading book and get your doubts cleared here. it will help you a lot than anything else.