rama murthy

Ranch Hand
+ Follow
since Jan 13, 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 rama murthy

Thanks for the response Gilles Marceau.

Yes we can do it.

Use util.Date's toString() method to convert the date to String form and use String's equals() method.

String's equals() method takes only date into account and doesn't consider milliseconds.

Here is the code and output


[ February 18, 2007: Message edited by: rama murthy ]
17 years ago
I need to compare the current dates ONLY. Not the milliseconds. Have a look at the code and corresponding output.



1. compareTo
2. equals
3. before

None od these methods are helping me, as they take milliseconds in to account while comparing the date.

Is there a way to compare ONLY the DATE without taking milliseconds in to account.
17 years ago
Thanks srini.

But even sql.Date is having a constructor that takes milli seconds right?

I didn't fully understand your answer.
17 years ago
could you please throw more light on this topic.
17 years ago
What is the difference between sql.Date and util.Date

Please don't tell sql date is a sub-class of util.Date
17 years ago
Thank you very much both of you.
17 years ago
Is it possible to get the current sysdate only using sql date. Because sql date has only one constructor that takes milliseconds as parameter.
17 years ago
Guys can you please tell one good forum for oracle discussion. Is there any site like javaranch for oracle.
17 years ago
class Test {

public static void main(String[] args){

new Test().stringTest();

}

public void stringTest() {

String secondName = null; // Version 1
String secondName = ""; // Version 2
String firstName = "Java";


secondName = firstName + " Ranch";

System.out.println(secondName);

}

}

What is the difference between version 1 and version 2 in initializing the String.
17 years ago
I am going to refactor a class that has around 10 methods. In every method I am instantiating the same class, lets call it "Display class".

So its almost 10 instantiations of same instance. Wouldn't it be a better design to put that instantiation in a singleton class and invoke the singleton from all the 10 methods. Wouldn't it save a lot of memory in heap.

If singleton is NOT correct kindly let me know why and other work arounds for this type of issues.
Kindly let me know the difference between

java.util.date and java.sql.date

When one should be used over another.
17 years ago
Eric I didn't understand what you said.

Kindly let me know whether what I said was correct.
Can we invoke a function that has 3 parameters with one.

like

function handleAccountEvent(evt, arg, rowId) { }

with

handleAccountEvent(EVENT_NEW_OWE)
Scripts in the head section:
Scripts to be executed when they are called, or when an event is triggered, go in the head section.

Scripts in the body section:
Scripts to be executed when the page loads go in the body section.

Is this correct. Is this a standard to be followed.