Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!

rajesh vasireddy

Greenhorn
+ Follow
since Jun 06, 2009
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 rajesh vasireddy

The output is 10 but please explain why how is int compared to double? is it through narrowing concept?

public static void main(String [] args) {
int x = 10;
double y = 10;
if(x==y)
System.out.println(x);
}

Thanks in advance
6 years ago
why do we create private constructors in java classes? And for creating that class object we give static factory methods. Instead why cant we dont we use public for constructor. Please help me. Thanks in advance.
6 years ago
if we increase heap size at server side will there be any change of performance. I am thinking this as if my webapplication got 1000 requests at a time then if i am using struts 2.x then there may be memory problems. So wil der be a change if i inc my heap size.
6 years ago

Manuel Petermann wrote:You can delete those entries from the xml and pass them to hibernate after configuration like:



Here what is this "uData", is it a POJO class with static methods?
I am sorry i am new so please explain little more closely.
Thanks for the help.
All people are saying Struts has performance issues as the FiterDispatcher (Contoller) creates a new action class object for every new request from a web client.
But in struts official website at Struts Offical Website

They said "Struts 2 Action objects are instantiated for each request, so there are no thread-safety issues. (In practice, servlet containers generate many throw-away objects per request, and one more object does not impose a performance penalty or impact garbage collection.) "

The red colored lines say it is not a problem but most of the people say it has problem.

So please real time struts developers in the world who have worked both on Struts 1.x and 2.x please say exact truth to world whether really struts has performance problems due to this aspect.

Thanks in Advance.
6 years ago
Hi Friends,

I developed a standalone application which uses hibernate for its persistance logic and uses mysql database on php server hosting.
as we know hibernate logic is with my standalone app at client side.
So now i want to run that app on multiple machines.

In hibernate we write configuration file in which we should give connection url as property along with username and password of database.
So is there any way that i can hide this configuration file and still make my hibernate app work on multiple systems.

Since all can see my hibernate configuration file so anyone can use my database details and get access.

please hepl me out.
Thanks in advance.

Hi Devaka Cooray,

Your Test Simulators are good.
Thank you for your valuable answer sir.

thank you very much buddy...

Replace two modifiers that appears in the Single class to make the code to compile.
Note: Three modifiers will not be used and four modifiers in the code will remain unchanged.
options given are...
final
protected
private
abstract
static
......................................................................
public class Single {
private static Single instance;
public static Single getInstance() {
if(instance==null)
instance=create();
return instance;
}
private Single(){}
protected Single create(){return new Single();}
}

class SingleSub extends Single{}

Henry Wong wrote:
I was thinking something like....



Henry




HI HENRY..

I ALREADY GAVE THIS BUT IT IS SHOWING ERROR
9 years ago
THIS IS THE PART OF CODE
yahooBasePath=properties.getProperty("YAHOOBASEPATH");
yahooBasePath1=properties.getProperty("YAHOOBASEPATH");

String[] tokens = yahooBasePath1.split("\\");
System.out.println(tokens[0]);
try
{
int len = tokens.length;
String url;
for (int i = 0; i <len; i++)
{
System.out.println(tokens[0] + tokens[len]);
url = tokens[i] + "\\\\";
}
System.out.println("url");
yahooBasePath =URL;

}
catch (Exception e) { }
9 years ago

Henry Wong wrote:

rajesh vass wrote:Hi guys,
I AM TRYING TO REPLACE THE BACKSLASH(\) WITH (\\) IN THE STRING BELOW
C:\Program Files\Yahoo!\Messenger\Profiles\
I AM UNABLE TO DO...SO PLEASE HELP ME...........

THANKS IN ADVANCE




Well, what have you tried? Have you tried the replace() method? BTW, you do know that strings are immutable, and that the best you can do is create a new string (with replaced values), right?

Henry



THIS IS THE PART OF CODE
yahooBasePath=properties.getProperty("YAHOOBASEPATH");
yahooBasePath1=properties.getProperty("YAHOOBASEPATH");

String[] tokens = yahooBasePath1.split("\\");
System.out.println(tokens[0]);
try
{
int len = tokens.length;
String url;
for (int i = 0; i <len; i++)
{
System.out.println(tokens[0] + tokens[len]);
url = tokens[i] + "\\\\";
}
System.out.println("url");

System.out.println("Propety Read :" + yahooBasePath);
}
catch (Exception e) { }
9 years ago
Hi guys,
I AM TRYING TO REPLACE THE BACKSLASH(\) WITH (\\) IN THE STRING BELOW
C:\Program Files\Yahoo!\Messenger\Profiles\
I AM UNABLE TO DO...SO PLEASE HELP ME...........

THANKS IN ADVANCE
9 years ago