srinivas srinivasmeenavalli

Ranch Hand
+ Follow
since Jul 13, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 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.
Hi,
We use below type of URL to show a page .
http://XXXXX.com/XX/XXXXX/-/YYYYYl#navigation=true&XXXX=VV&XXX=14&XXXX=VVVV&XXXXX=VVVV&XXXX=/-/XXXX=true

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
8 years ago
Another approach could be

Refer
https://coderanch.com/t/325620/java/java/make-true-Singleton-even-if



out put :
Instance Id=org.sri.design.ptrn.singleton.Singleton@5b8c5b8c
Instance Id=org.sri.design.ptrn.singleton.Singleton@5b8c5b8c
Instance Id=org.sri.design.ptrn.singleton.Singleton@3a6c3a6c
Instance Id=org.sri.design.ptrn.singleton.Singleton@3b4c3b4c


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 .
8 years ago




out put

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


I tried with out constructor.It's working good.
Can you tell me how to use constructors in dynamic class loading ?
8 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() ?
?
9 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
Double=Infinity

May i know why ?
9 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 ?
9 years ago
Hi,
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 :
charA=a
charB=?
charUniCode=?
9 years ago
Hi,

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 ?
9 years ago