Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

srinivas srinivasmeenavalli

Ranch Hand
+ Follow
since Jul 13, 2008
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 srinivas srinivasmeenavalli

We used Java Servlet API to redirect in source code. I tried to reproduce the same from fiddler ( HTTP Debugging Proxy) . See screen shot from attchments.
We use below type of URL to show a page .

when somebody is trying to enter a different "YYYYYY" value in the browser , web server will redirect to above url based on a unique ID.
Isuue is here while redirecting Internet Explorer truncates parameters after # . Same works good in other browsers.
you help would be appreciated.
Don't share your user credentials to the Group
10 years ago
Another approach could be


out put :

I am not considering distrubuted applications. Private defualt constructor is not sufficient to make singleton.
We have to use parameterized constructor to avoid this problem for Example
private Singleton( int dummyArg){

} . in this example.What do you say ?
working with no-arguments constructor .
10 years ago

out put

java.lang.InstantiationException: org.sri.corejava.basic.Jeep
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(
at org.sri.corejava.basic.ClassLoadingExample.main(

I tried with out constructor.It's working good.
Can you tell me how to use constructors in dynamic class loading ?
10 years ago
I agree with Wouter Oet.You have to write lot of sample programs to learn any programming language.
For example I want to know how to use StringBuffer Class. I always have a sample program with all String Buffer API's.
We can load a class by using either Class.forName() or ClassLoader.loadClass() dynamically.What is the general practise in Java ?
is it Class.forName() ?
10 years ago

I was expecting Infinity as out put for above code.
Oout put

Int Value=2147483647
Long Value=9223372036854775807
Float Value=Infinity
Byte Value=-1
Short Value=-1

May i know why ?
10 years ago

Not my practice and not a practice mandated or even encouraged anywhere I have worked.

James Sabre , what is your practice ? Did you use Properties files to have constant values, which never be changed ?
10 years ago
I was expected to see special characters by executing below source code but not dispalyed my eclipse.
what i need to do to support unicode characters ?

Out put :
10 years ago

maintaining all constants in a constants java class is one of general practices of java coding.
Q) Why can't we add constants to an Interface ? We can access constants by importing an interface in source code

Q ) I can achive the same through Java Enum also instead of a constants java class . Which gives better performance ?
What do you suggest , why ?
10 years ago