Help coderanch get a
new server
by contributing to the fundraiser

mahesh jhamtani

Greenhorn
+ Follow
since Jan 12, 2001
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 mahesh jhamtani

Hi John and Party,
Don't cry H1B and H1B and H1B..
Forget this thing that H1B does not have performance.
Much better then people who need calculator to add two numbers...
If you want to listen let me know...
Can´┐Żt write much, busy in couple of projects...
Bye for now.
23 years ago
Hi
I am getting value of text node as NULL.(which is not null)
Can you tell me what is wrong in this code...

Element el = doc.getDocumentElement();
NodeList nl = el.getElementsByTagName("Name");
for (int i=0; i<nl.getLength(); i++)
if(nl.item(i).getNextSibling().getNodeType()== Node.TEXT_NODE)
{Text textNode = (Text)(nl.item(i).getNextSibling());
String text = textNode.getData();
if ((text != null) && text.length() > 0)
System.out.println("value of node is " + text); }
Thanks.
Hi,
I am having a problem when I try to run Java program which parses
a XML file.
I am using JAXP for parsing XML file.
It compiles it well, but when I try to run I get error:
Parsing error: File "C:\...\test.xml" not found.
Can anybody tell what is wrong here.
Thanks.

I think answer will be compile time error.
Child class cannot override a method in parent class if it is more restrictive then parent class method.
In parent class method sample has public access, while in child class it has default access.
Please correct me if I am wrong.
Thanks.
Tualha :
I was not trying to discourage you.
I am not agree with you that java is dead.
Don't believe on those recruiters.
participate in some open source project.
Keep on trying to get entry level job.
It is difficult to enter in the market, but not impossible.
Hard work always bring success.
Goodluck to your jobsearch.
23 years ago
Let me give you solution....
Don't do anything....
What you are going to do will also be dead in a couple of months.
Try to do something different then IT.
Which will remain alive forever.
Let us know which will be alive forever.....
23 years ago
Can you tell me in this case a is instance of Base or Agg.
Thanks.
------------------
23 years ago
code is not giving me any error.???
23 years ago
For your answer program should be like that:

public class abc
{
public static void main(String args[])
{
StringBuffer sb1 = new StringBuffer("Amit");
StringBuffer sb2 = new StringBuffer("Amit");
String ss1 = "Amit";
System.out.println(sb1.toString().equals(sb2.toString()));
System.out.println(sb1.toString().equals(sb2.toString()));
System.out.println(sb1.equals(ss1));
}
}
23 years ago
Can you equate object this way...
String is object in java not primitive type..
So if we use == operator to equate instance of String object
we will get false only.

Originally posted by Vineet Sharma:
Hi to all,
I am sorry I typed the wrong code !
The right one is:
public class Test{
public static void main(String args[])
{
String s1 = new String ("amit");
String s3 = "arit" ;
String s2 = s1.replace('m','r');
System.out.println(s2==s3);
}
}
The answer to this code is false. Can some body explain?
I think it should be true and my reasoning is that the line "s1.replace('m','r')" will return a new string containing "arit". Now since the string "arit" already exists in the string pool (as created by s3) s2 will also start pointing to the same memory location. Therefore the variables s2 and s3 are now seen pointing to the same memory location and hence s2==s3 should be true!
Sorry for the long explanation. Once again thanks to all for the help...
Regards
Vineet


23 years ago
Try this
public class Test{
public static void main(String args[])
{
String s1 = new String ("amit");
String s2 = new String ("arit");
String s3 = s1.replace('m','r');
System.out.println(s2.equals(s3));
}
}
23 years ago