Amit Goel

Ranch Hand
+ Follow
since Dec 07, 2000
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 Amit Goel

yes this can be done.. only if those DVD library managers support it.. i'll give you an example.. in the satellite TV world.. it happens that you can download all program information in xml format using XMLTV standard format..
you can google XMLTV term and know more about it.. it is pretty simple to do but needs support from service providers.
Hi Gauhar,

If i am not wrong , by exporting a tree to html, you mean to display the tree in html view.. if that is the case, u need to use style sheets for the display.. use XSLT for the same...

if you could be more specific about ur would be great..

That was a pretty big stack thrown

anyway, if u r sure that u r following the correct procedure and are not missing any step... i am really wondered how this unusual stack is curned out..

okay.. can u mail across the code to me.. i'l also have a look . although i havent used dom4j doc but then also , i 'll try to have a look..

my email id is
Hi Aparna,

Have you tried this?

create a new document builder as you are creating new xml doc. try to use the below mentioned example...

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.newDocument(); // Create from whole cloth

Element root =
(Element) document.createElement("rootElement");
root.appendChild( document.createTextNode("Some") );
root.appendChild( document.createTextNode(" ") );
root.appendChild( document.createTextNode("text") );

} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
using hints in the query may also help in optimizing it
Hi Sameera,

Here is another workaround..

Use AWT graphics object and create a button on ur own. I mean instead of using JButton, create a round figure with bevel effect which will look similar to a JButton and then using MouseMove and mosueClick method and verifying the co-ordinates , u can simulate the click action.

this will give you 100% round button without any invisible square areas ..

if you liked this and want to have more details.mail me at
16 years ago
abstract methods are meant to be overridden as they don't have a body and the implementation is expected in a subclass..

and static methods cannot be overridden as they are class methods and not instance methods. means that they ar shared across objects .

so abstract and static are against each other and can't co-exist

Hi Sangeetha,

There can be as many overloaded main methods u wish. There can be only main method with the signature

public static void main(String args[]){

rest whatever main methods u declare they will be just the normal overloaded methods, and they can be uased as other normal methods are called.
Hi Riya,

By using Serializable interface , JVM takes care of the object information and serializes it as per the standard process including all the info as specified.This is the null interface.

By using externizable interface, You need to take care of serializing the obejct , and implementing the readExternal() and writeExternal() method.
In these two methods, you will specify the properties. and serialization code urself.

Externizable interface is used in the cases where ur requirements are much more than simple serialization. and u need to add more information than the normal one.

I hope this helps.
Just break down the statement i = i++; in the following three statements to make it atomic operation..

temp = i;
i = i + 1;
i = temp;

this breaking down makes i always vaulate to 0 (zero).

for eg: j = i++;
if you print i in this case it will be 1 and j will be 0(zero).

temp = i;
i = i + 1;
j = temp;

I hope this helps.

Hi Ritu ,

Okay the explaination is like this..

In the first case, where you have declared int i,
YOu have declared int i at class level, which makes it instance variable and int i declared inside the method as a parameter becoems a local variable which shadows the class level variable.

So in the method if u access i, it will be accessing the local variable i and not the one declared at class level, to access instance variable i, u 'll use 'this' operator.

In the second example, it is not the same case as expalined above.

okay, shadowing happens in cases of parameter passing and inheritence (only when u extend classes).

so ur first example is case of shadowing.

and ut second example gives compilation error as there is no shadowing involved and it breaks the rules of variable declaration where my earlier explaination gets valid.

i know u'r bit confused. just read a bit more about shadowing and variable declaration.

As i don't log on to javranch often, if u have any problems or clarifications , u can contact me at or

it will print


False because the NaN represents a number between positive and negetive infinity which is fiddefrent for two different NaN's.

TRUE because NaN is represented in two ways...for eg: u can have two

you can read the specification given in Java API docs in Double class..
[ September 14, 2005: Message edited by: Amit Goel ]
Hi Ritu,

This is a fresh explaination irrespective of the comments given by others..

if u declare index at line 1 ,

then scope of "index" variable is for the whole main method and as 'for' block comes inside main method , it is available for 'for' also. and it will give compilation error.

where as if u declare 'index' at line 2
the scope of 'index' declared in 'for' block gets over earlier only as scope of 'index' declared inside 'for' is only that block and not the whole main method. so when u declare it again after 'for' completes , it is taken that index declared at line 2 with scope of main method . and 'for' loop is not related to it as it has come prior to the declaration of line 2.

i hope this explaination helps.

Hope this below mentioned URL Helps..

According to JLS , the most specific method is chosen..

Java Language Specification Choose the Most Specific Method
Hi Divakar..

As u have pointed out about return type .. the return type of the method has no effect on println .. even if u change the return type it will still print the same..

its all about pass by value..
java does not support pass by reference.