sandhi mridul

Ranch Hand
+ Follow
since Jan 25, 2008
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sandhi mridul

Hi Amey,

I am also planning to give the same certification. Did you get any idea or details about the certification. Do let me know.
We are on the same boat.

Sandhi
14 years ago
Hi Guys,

I want to do IBM RAD certification and want to know all your experience who have done it already.

I am a bit worried about as I am a fresher and want to get job with this certification.

Thanks for all your help in advance.

Sandhi
14 years ago
Hi,



output: false
true
false
true

As per rule a.equals(null) should always be false for any non-null refrence of a.
Then why at line 2 and line 4 the output is true?

please help me with this.

Thanks
Sandhi
According to my voucher date format--for you it should be October-4th.
But again you should be knowing in which month you bought that voucher.

Sandhi
HI,

I have confusion in assertion statement.

assert Expression1:Expression2;

aseert statement should not change or alter the value of any variable.

so,

assert i%2==0:i++; //line 1


assert i<100:i=i%100; //line 2


assert x-->0; //line 3



According to me all the three statement give compile time error as they are altering the values.
Am I right?

one more thing:
At compile time the compiler look for the complete assert statement means both Expression1 and Expression 2 and if any statement alter the value(any side effect found) will give compiler error.

Am I right?

Correct me.

Thanks
sandhi
Any Method which does not have return type "void" should have return statement of the valid type.
I am sorry Henry.
While typing I missed the imp thing -the dot operator.
I have corrected it.

Thanks
But still need the ans
Hi,



output:-T2,T3,T2,T2,T3,T2
What is going on in this code?
Please help me with this.

Thanks
Sandhi
[ March 14, 2008: Message edited by: sandhi mridul ]
Hi Hamsagayathri,

If you take the

It behaves like any method
with the name "main" which is "static" and the return type is "void" takes "String array" as argument.
So it will compile without any problem just like any other method.
But if you try to call any other method from this main method specially whih is out of the scope of the default modifier then it will throw exception as the modifier here is "default".

That is why it shld be public and can also be final.


Hope this help

Sandhi
Hi,



I compiled this program giving error at line 1.
If Line 1 is the assert statement then I will say its not the proper use.
If its a Identifier then Is it a problem of compiler 1.4. As assert Identifier can be used on 1.3.
Please help.

Thanks
Sandhi
Hi Dinesh,

Whenever any of the construtor get called weather its subclass constructor or superclass the execution always start from the default constructor of the superclass.
That is why the o/p is 123.
Your code is not OK.I did changes.

Execution goes like this

In main() method the Cert3() get called.
class hierarchy goes like this
cert 1
|
cert 2
|
cert 3

Now as the cert3()default constructor is at the last in the hierarchy so the call goes automatically to cert1() default constructor that is super class.
so now the output will be like
cert1() ->cert2()->cert3()

o/p 123

Hope this help


Sandhya
[ March 13, 2008: Message edited by: sandhi mridul ]
Ohh yaa.
sorry for overlooking.
Thanks for all your reply.
Hi,


ans=An assertionEROR with -2 as message is thrown.

My question is when line 2 is called ,why its not throwing assertion error at line 1?

Thanks
Sandhya
[ March 13, 2008: Message edited by: sandhi mridul ]
Hi Keith,



The execution of the above code proceeds like
First of all --all the static block get execute weather they are in subclass or superclass.
o/p r1,r4
Second the execution goes to the main block n start the execution
o/p pre
now the call to constructor
new Hawk();
As per the rules the call will go to the superclass constructor first and then the subclass.
The rule which you are missing here is that all the instance variable and blocks gets executed before the default constructor get execute.
That is why. o/p--b1 b2
then in subclass o/p --r3 then r2(first the block then constructor)
finally o/p--hawk

the complete output will be r1 r4 pre b1 b2 r3 r2 hawk

Hope this help


Sandhya
[ March 12, 2008: Message edited by: sandhi mridul ]