Thursday, March 31, 2005

Java: Object Array Casting

Here is one interesting problem which I confronted in Java yesterday.
Well I was thinking I knew Java Language reasonably, but yesterday I ran into this issue which has left me pondering what is my level of proficiency in Java?!
Here goes the problem

String[] s={"Hello","There"};
Object[] o=(String[]) s;
for(int i=0; i System.out.println(o[i]);

Looks simple enough! but was shocked to find out that the above simple code resulted in an Exception - ClassCastException!!
Aren't those simple casts allowed? After all casting is a method which comes Handy many a times esp. in RTTI. I was wondering "How Come?"
At the end googled and found that array casting from object to another is not possible in Java. Means to say that all Strings are Objects, so go ahead and cast String to an Object. But all String arrays are not Object arrays. You can individually cast all member but not as a whole!
Interesting learning for me this one, even though I think this just one the primitive things which I have conveniently ignored.

Monday, March 28, 2005

Spineless India

As expected India has lost the crucial test match with Pakistan at Banglore. Its shame on India to have lost without even putting a semblance of fight back.
India team is said to shredded with bounties of innate talent, but when it comes to pressure situations and winning matches they lack the instincts. They are just spineless cowards playing for preserving their places in their team.
Look at the way they have fared today - once Sehwag was lost the vice captain came in and created the pressure from nowhere by being over defensive. Does the so called talented player doesn't have the gumption to take a single of every 4 balls and atleast keep score board ticking. And even more ridiculous is the Master Blaster - every time when people expect him to bail out he cracks under pressure. Look at the score 16(95). By not playing naturally they just invited the Pakis to go on full steam and they were too happy to attack and go for the kill.
Its really outrageous to see VVS and Gangs batting in the whole series, I guess its time to give them a break a groom young bloods.
Win/Loss there should be a grace in it. If you are not even trying for it and caving in the shell meekly, its shame on you the over paid, over hyped Indian XI. You are an embarrassment for the country and let down for thousands of die hard fans.
This bunch of pakis have been pictured as weakest team to visit India and current coterie of India is projected as the best being produced. Just an ample truth exposed today of the quality and standards.
Its time to take a few attitude lessons from Viru.
Rubbing salt to the injury is the Indian media, which has given prominence to Tendulkars INDIVIDUAL record of surpassing Gavaskars' run tally rather than the ignominious defeat.
Spineless Indian Team take a break and drink Mothers Milk.
Interesting comment on cricbuzz - Indian time looks like a walnut, looks tough to crack but once broken just crumble into pieces.

F16s to Pak

The imperalistic Bush Regime has again weeded out its evil design. This time through sale of Multi Combat state-of-the-art aircrafts to Pakistan. At this point of time when we (India and Pak) are in road map to peace, by way of cease fire, by way of cricket matches, by way of road links, by way of gas pipe-lines, the US the so called harbinger of democracy is at its autocratic best by being fetish in creating anarchy in the region.
The US never want peace in rest of the world. An unstable Asia means they can flex their muscles and exploit the resources here for their comforts.
The blatant lies which Ms. Rice had said when she was in India are nakedly exposed. What she had mentioned was that there was no plan for F-16 deals with Pak now, but hardly a couple of weeks ahead US is going ahead with a couple of dozen F-16 consignments to Pak as a part of reward for its fight against terrorism. No body is clear as to what role Pak has played in war againg terror when Pak itself is the greatest haven for terrorists and Jehadi's. But US doesn't care they want their interests to be in fore-front putting in peril the lives and interests of rest of the world.
Soon India will also go in for a shopping of MCAs. But India shouldn't buy US technology, as they won't hesitate to hold us is in ransom during servicing of these aircrafts or transferring some technology during later years for fostering their interests. It would be best served for India, if we can buy MIG-21s from Russia, with whome we have good relation or even Mirage from France or Gripen from Sweden. Say NO to F-16s or F-18s.
Its a irony for the whole world that 6% of people (US) are trying to exploit 94% of people in this planet through imperialism and military power.
Lets hope for the day when imperalists will meet with their nemesis as a prey to their own evilness ........for its not impossible!

Friday, March 25, 2005

New to Blog World

Well this is my first experience with blogs.....
I have seen it being used extensively by blokes around me...I used to think it was only for geeks!!
I am not sure what I am going to post here and how frequently I am going to use it.
Any way its a new begining

This page is powered by Blogger. Isn't yours?