Rocky Roy

Greenhorn
+ Follow
since Aug 04, 2010
Merit badge: grant badges
For More
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rocky Roy

Jesper de Jong wrote:You expected: false, false, true

And you are getting: false, false, true

So, you are getting exactly what you expected?

I would have expected: false, true, true

Note that the intern() method puts the string into the string pool and returns a reference to the string that's in the pool. String literals are already in the pool, so s2.intern() will return the reference to the string "hi" in the pool, which is the same string as the "hi" literal that s1 refers to.




thanks for frequent response....
you are right initially i was expecting false, false, true.
but when i compiled and executed the code i got false, false, true... [its also interesting but this is not my question].

just analyse the expected and actual output closely

for example
for line

System.out.println(" s1==s2 :: "+s1==s2);

expected output is::

s1==s2 :: false


but in actual out put is ::

false

the string "s1==s2 ::" is not there in out put.

if you modify the code from

System.out.println(" s1==s2 :: "+s1==s2);

TO

System.out.println(" s1==s2 :: "+(s1==s2));

you will get expected out put i.e. ::

s1==s2 :: false


Similar is the case with remaining System.out.println lines

I am unable to understand reason behind this behavior. Can you help me with this



8 years ago
Consider the following code




I was expecting out put as
s1==s2 :: false
s1==s3 :: false
s1.equals(s2) :: true



but in real i am getting


false
false
s1.equals(s2) ::true



Can you help me understand WHY ?
8 years ago
Yes you r very right...

this is the point where i am blocked in process ...
12 years ago
please help me with above issue

i tried search many time but still no answer found
12 years ago

Lester Burnham wrote:How did you determine that there's a need to improve performance?




i though the precoussion is better than cure,
because while in testing phase there was some issue related with heap size, i over come them by increaing heap size

so if there are any best practices for hosting site on tomcat or does and donts of same please tell me
13 years ago

Lester Burnham wrote:Why do you think any modifications are necessary? What do you have in mind?





i though there must be some optimization tricks are required to improve performance of tomcat.
13 years ago

Campbell Ritchie wrote:Welcome to the Ranch

Lester Burnham has a good point.

Please search this forum and "Beginning Java" because several other people are asking very similar questions just now.




>>>>>>>>>>>>

all the post i gone through
are just doing one way communication with process
but what i want to do is to create java wrapper to execute c program exe


for example :

Wneh program will print
Enter The Number :
i will display this message in jave frame.
and ask for input from user and pass the same to c program exe process.

and again get what ever the feedback of program to the java frame;

so it is a kind of 2 way communication with process
by handling
stdin,stdout,stderr and what ever...
13 years ago
hi all,


I want to host an internet site developed in j2ee and my hosting server will be tomcat 6 on windows server 2008, so what are the modification in tomcat are must to be done.

i am new to deployment phase please help me out..
13 years ago
all the post i gone through
are just doing one way communication with process
but what i want to do is to create java wrapper to execute c program exe


for example :

Wneh program will print
Enter The Number :
i will display this message in jave frame.
and ask for input from user and pass the same to c program exe process.

and again get what ever the feedback of program to the java frame;

so it is a kind of 2 way communication with process
by handling
stdin,stdout,stderr and what ever...
13 years ago



My target is to run external exe file throught java programm and communicate with it.
i am able to get the out put of exe but faceing problem with blocking calls.. i will explain:

For example

if i want to get out put of c program i.e. test.exe ( it will print hi on console if we run this file directly)

then by using following code




I get out put as
hi

on java console

but if a c program has bloaking call in it
for example let test.c contains a code




now when i run executable file of above program(test.exe) using java code given above it will goes in
infinite waitting state.
i think the reasone is text.exe wait for user to give input but in this case user is a java program who
dont have any idea about that so process goes into infinite waitting condition..


So My question is

>>>>>>>>>>>>> WHAT TO DO ???

i want java program to print " Enter number = "
then user will give number
the number given by user to java program should be passed to
test.exe
and final out put "You entertd =(number given by user) " should be printed on screen





13 years ago