anandkumar gangoni

+ Follow
since May 30, 2004
Merit badge: grant badges
For More
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 anandkumar gangoni

an addition to wat i said

If NaN is the argument passed to Math.round, then the return value is zero.
Hi Friends,

Iam writing my test on next monday. I have gone thru \\sl0074new\Shared\Anand\Anand\java certification\preparation\Java Programmer Certification Mock Exams.htm and also using marcus green mock exams and prepared khalid a. mughal and rolf's "A programmer's guide to java certification" on 1.4.

Now I am looking for some new free mocks exam which are just specifically for sjcp1.4 where I can find an exam just on 1.4 objectives and which has questions which r near to the real exam.

if any one has the links for that plz post the links

thanks in advance
well... Math.round method comes in 2 flavours where one form returns int on taking float as an argument and the other return long on taking double as argument.

whether the argument is negative or positive wat it does is........ it adds 0.5 to the argument and returns the floor value in int or long type depending on the argument provied.

shall be waiting to here from you.
till then this is Anand saying....

I compiled by including the option a and it worked well for me. I am not sure how u got that error.

but some time back I encountered a pretty similar pbm which had the same error as u said... at present I don't have that code snippet with me.

anyways thanks for ur views.
but when I executed the code it compiled & executed with out errors. I am talking abt. option a.
class Trebble{
int i = 99;
class Base extends Trebble{
int i =100;
public class Central extends Base{
public static void main(String argv[]){
Central c = new Central();
public void wynyard(){
Trebble t = new Central();
Base b = (Base) t;


the ouput here is 100... I am not getting how exactly it is.

wat i understood is when variable memeber is accessed the variable of the reference type is used and reference type can be only the next immediate supertype in the inheritance hirarcy.

I would be happy if anyone cld ve better explanation.

yeah u r correct c and e give pbm becoz of return type incompatible pbm. And is also not giving error when I compiled. I think the answer given is worng.

01. public class Test {
03. public long add(long x, int y) {
04. return x + y;
05. }
07. public static void main(String[] args) {
08. byte x = 5;
09. int y = 6;
10. Test t = new Test();
11. t.add(5, 6);
12. }
13. }

which of the following methods can legally added to class Test?

the options:-

a.public long add(int x, long y) {return x + y;}
b.public int add(int x, int y) {return x + y;}
c.public byte add(byte x, byte y) {return x + y;}
d.public int add(int x, byte y) {return x + y;}
e.public short add(byte x, int y) {return x + y;}

the answers given is b and d.

this is given in But when I compiled and executed this all options were correct.

I think the answers given is worng.

plz someone help me on this confusion to get resolved....

Thanks in advance.
the point here is class C inherits the method show() from class B. and second point is call to a method depends on the actual object in the reference at runtime (but plz make a note the method declaration should also exist in the reference type orelse it will give compilation error).

so here a and b references have C object so the ouput will be B followed by B b'coz the method in class B which is inherited by class C and is called at runtime.

Thanks Sundar,

I got it, and did well in the exam with 8 questions being correct and rest 2 questions I answered worngly b'coz of lack of concentration at the time of taking exam.
Questions with Checkboxes

Note that questions which may have multiple correct answers show square checkboxes. In the current Sun exam, they give a hint as to the number of correct answers in this type of question. Since this was not true in earlier versions and may change back. this information I could find from one of "Java 2 Programmer Certification Exam Simulation Applet.htm" by w brogden.

so now the current exam will give a hint as to how many number of correct answers in multiple choice questions.

Thanks for your reply.
I am following Khalid A. Mughal book "A Programmers' Guide to Java Certification"(310-035) in that it is mentioned that(on page No. 493) for multiple-choice question, the program will ask the candidate to select a specifice number of answers from a list. Also in the mock exam of this book it is given how many answers have to be selected for all questions.

Can you give me precise information on it please?

I am able to reach the page which u mentioned... but I am unable to proceed further from there to reach the sample questions.
Hi Friends,

I am writing my sun certification exam this weekend. I am having one doubt about the real exam.
In Multiple choice question, will it be mentioned about the specific number of answers to be selected from the option list?
If you guyz can clear my doubt it would be better for me.

Thanks in Advance.
Sun offers a few example SCJP2 test questions from their certification site. Don't miss them. the url for the site is but I am unable to get the free 10 sample questions

Can anyone plz tell me how to get those questions.???

Thanks in advance.,