Rajesh Chandra

Ranch Hand
+ Follow
since Jun 13, 2005
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 Rajesh Chandra

Thank you Sebe but as Prathiba pointed out it may work with strings too.Well I tried and it doesnt.In what all cases can we expect such situations? How to be sure to be precise in scjp exam??
regs Rajesh
13 years ago
Hi ,
I stumbled on this question-

Given that the objects denoted by the parameters override the equals() and the hashCode() methods appropriately, which return values are possible from the following method?

String func(Object x, Object y) {
return (x == y) + " " + x.equals(y) + " " + (x.hashCode() == y.hashCode());
}

Select the two correct answers.

a "false false true"

b "false true false"

c "false true true"

d "true false false"

e "true false true"
The answer is a and c .How can it be?
In option a if x.equals(y) is false then how can be (x.hashCode() == y.hashCode() true?
regs Rajesh
13 years ago
Thank you so much Valentine,finally I managed to compile the ejb and dploy it.I changed all the classpath and it worked out.
regs Rajesh
Well Valentin as you said we can place the output of build in another build file as given
ant �f c:\dev\prj\another_build.xml <target_name>

I want to compile the ejb placed in C:\j2eetutorial\examples\src\ejb\converter and my build.xml is in C:\j2eetutorial\examples
Should I create a new folder to place the build file? In my tutorials context how to go about.
Further the tutorial says it is configured to work with ant 1.3 but Im using ant 1.6.5 >Is it because of the version Im not able to compile my ejb?
regs
Rajesh
I have ant1.6.5.I have some sample ejb in my folder C:\j2eetutorial14\examples\ejb\converter\src.
How should I set my ANT_HOME variable and how should I compile the ejb and after compilation where it will be stored?Can anyone show me detailed step by step process
regs
rajesh
13 years ago
Thank you so much valentin now the path problem is over but it says the build.xml doesnt exist and build failed.Im new to j2ee .Can you show me through how to compile an ejb? I have weblogic but it looks scary with vast documentation.
regs Rajesh
hey Valentine,
I have in my PATH variable (using windows xp)

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem%ANT_HOME%\bin;
I also tried with this one
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%ANT_HOME%\bin;
It doesnt work anyway.
regs Rajesh
I have in my environment variable ANT_HOME set to c:\ant1.6\bin. Is there any more that I have to do?
I have installed j2sdkee1.3.1 in c:\ and i managed to run the server.I downloaded the tutorialbundle(from sun) which i want to run.i Created a new application from the deploy tool,ConverterApp.
Now I want to compile the remote interface (Converter.java), home interface (ConverterHome.java), and the enterprise bean class (Converter-Bean.java).
In a terminal window, i went to the j2eetutorial/examples directory and typed the following command: ant converter and I get the error ant is not recognized as internal or external command.Im using ant 1.6.5.Can I compile with this tool?If so How?
regs Rajesh
hey manis I tried it successfully.you too try it
Now im able to start the server and the deployment tool.However the cloudscape database doesnt start.
regs rajesh
i have j2sdk1.4.1 which runs fine and I already have my JAVA_HOME SET TO j2sdk1.4.1 .Now I tried with your idea too Agastya but its not working>The same error is indicated.
regs rajesh
I have j2sdk1.4.1 in my system and Im using windows xp professional
I installed j2sdkee1.3.1 in c drive and I set the path in my autoexec.bat as follows
set PATH=%PATH%;C:\j2sdk1.4.1\bin;C:\j2sdkee1.3.1\bin;
set CLASSPATH=.;%J2EE_HOME%\bin;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale
I also tried adding to JAVA_HOME ENVIRONMENT VARIABLE j2sdkee1.3.1 .
I have j2sdk1.4.1 in c drive and its running fine but when i type j2ee - verbose in c:\j2sdkee1.3.1\bin I get this error
set JAVA_HOME TO valid path of jdk
Since Im a novice I'd appreciate any help forthcoming
regs rajesh
please refer to the code below


public class MyClass{

public static void main(String[] args) {
int a = 0;
final int b = 1;
int[] c = { 2 };
final int[] d = { 3 };
useArgs(a, b, c, d);

System.out.println("INSIDE Main "+d[0]);
}

static void useArgs( final int a, int b, final int[] c, int[] d) {

d=c;

System.out.println("INSIDE METHOD "+d[0]);
}

}

The final int array d is passed as argument to the method useArgs().The final keyword is supposed to not let the reference point to any other object other than the array with element 3
but here inside the method d refers to another array c and compiler doesnt complain .why?
is it because the formal parameter is not final? However in the main method it still points to the original array.So does it infer arrays pass by value however I know it should pass by reference??

regs Rajesh
13 years ago
Thanks to Ulf & Jeff .The link that was posted is too volumous.Do you know of any place wherin I can get the basics explained in a simple way.Anyway is there a way by which we can ascertain that the aritmetic will be different as in the above case?
Regs
Rajesh
13 years ago