om ganesh

Greenhorn
+ Follow
since Dec 06, 2006
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by om ganesh

Saw the updated official site for Java, java.sun.com ... man

Visually the site has become an eyesore...

Hope they dont mess up Java's features in a similar manner.


14 years ago
Hi Rob,

Why should Constructor with argument type Integer be choosen over constructor with argument type Object.

Is the " null " value in java lot closer to Integer or String object than the Object class ( which is the parent of all classes in java).

@Campbell

I was under an assumption that
when a null value parameter is passed it means that there is no parameter being passed ( same as zero no of arguments ) .
Please correct me if I am wrong.

14 years ago
Hi All,


I just was java Constructor when I came across a behavior.

The Constructor has been overloaded thrice
1 - Default constructor
2 - One constructor parameter of type Object
3 - One constructor parameter of type Integer

Here is the code which I wrote



But when passing null value to the constructor

constructor with Integer as a parameter is being called. - Shouldnt Object be called over here.

Constructor with Object is called only when an Object type value is passed explicitly- By my understanding this should happen even when null value is passed.

-- I tried adding a constructor definition with String parameter then got a compilation error - saying Ambigious call.

But as Integer is a sub class of Object , Constructor with Object as a parameter should have worked but the behavior is opposite.


Can any one explain this to me, what is really happening internally ?


Thanks in advance
Omganeh
14 years ago
Thanks uj nossnahoj & Campbell Ritchie

uj noosnahoj - will be trying to write it, will keep you folks posted on it.
14 years ago
Hi All,

I am trying to encode recursion using Java.

I would like to know an efficient approch where I can bring down the nummber of variables being passed as method parameters. - Without adding to the Method Call Stack - I basically would like to come up with an approach which would make use of least number of local variables per method call.

for ex
In merge sort we basically use recursion, basically call recursion using divide & conquer technique.

but in worst case scenario if there ar many number of elements there would be lot of variables added to the method call stack.

is there a way around this ?

14 years ago
Hi All,

I am new to Java & am tring to use XMLGregorianCalendar
to
get a date in format of "2009-10-07T06:00:00+0530"

Right now am using new DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar(System.currentMilles()));

to get the date in this said format.

I am unaware of how to update the date value by a day or a minute .. using Duration API
eg ...
"2009-10-07T06:00:00+0530"
to
"2009-10-07T06:01:00+0530"

It would be good if any one can forward me some ReadMe on Java's Duration
14 years ago
Hi All,

Am running into a issue which is appearing strange to me


In this code I am explicitly closing the socket connection but then to "Socket.isConnected() " method returns true - "saying socket is still connected"

Could some one help me understand this behavior properly.

Thanks in advance,
Omganesh
thanks very much Ulf Dittmer thanks ...
14 years ago
Hi Ulf Dittmer,

Am trying to access this link for past 3 days .. without avail

Tried it from 3 - 4 diffrent locations but getting "Connection Timed out " error

Few of the tasks are held up due this.

Accessing the SVN seems to be the best option for me..
Just need to access the Code

I just am not able to come up with a option for accessing the source


Thanks in advance

Omganesh

14 years ago
Hi Ulf Dittmer.

Could you please copy past the steps for checking out the JAX-WS source code from SVN.

I am able to ping the machine, but not able to load the pages.

Thanks in advance,
Omganesh
14 years ago
Hi All,

I wanted to access JAX-WS source code, but the link https://jax-ws.dev.java.net/2.1/

Seems to be not working, Could any one point me to a location from where I would be able to access the code


Thanks in advance,

Omganesh
14 years ago
Hi all,

A doubt occurred to me w.r.t Threads, am playing around with thread

Does declaring a member variable as private affect the way a thread behaves with that variable.

Scenario 1


Scenario 2



This might not worth be a question to ask for, but i am bit new to threading & java - am trying most of the things out on my own so want to clear few concepts.

Also it would be great if some info is given on how a thread's stack might appear- like what all variables will each thread instance have to share or will have an instance of its own.

Just tried with ConcurrentLinkedQueue,

the sample program ran smooth.. without much ...

here is the code .


Thanks Henry & Steve for the response..

Steve's question
what kind of data do you want to transport?
I am reading Objects from a data source and then passing them onto the Queue / Pipe.

I would now try out the ConcurrentLinkedQueue & see how it goes.


was playing around ... with the PipedStream..

Faced the Scenario which Henry had mentioned .

2 Producer threads are using the same PipedOutputStream reference but the pipe is broken if any one of the Producer terminates before the other

So the Producer thread which finished first would have to be running until the Producer 2 thread too has finished.

One more question.

If i go ahead with the PipedOutputStream, can data over 1MB be stored in it until it is read by the Consumer ?