Meaningless Drivel is fun!*
The moose likes Java Micro Edition and the fly likes GreogorianCalendar!? how to work it out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "GreogorianCalendar!? how to work it out" Watch "GreogorianCalendar!? how to work it out" New topic
Author

GreogorianCalendar!? how to work it out

omar bili
Ranch Hand

Joined: Aug 13, 2004
Posts: 177
Hi
i'm trying to convert a normal class to a midlet, this class contain an instance of the GregorianCalendar... the j2me classes dont contain GregorianCalendar it only have the interface Calendar (surely i cant create an instance of this class)
is there a way to solve that??
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Isn't there a Calendar.getInstance() method that returns a Calendar? Then you have an instance of an object that is of type Calendar. This allows the phone manufacturer to implement their Calendar version and the getInstance will return that one.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
payal agrawal
Ranch Hand

Joined: Oct 11, 2005
Posts: 44
Look at the URL below:

How to display Calendar in mobile device
http://www.java-tips.org/content/view/421/73/
omar bili
Ranch Hand

Joined: Aug 13, 2004
Posts: 177
wow getInstance worked, but please can you tell me how was that??
the Calendar is an interface.. what does this function return!?!?
and is it function that exists in a lot of interfaces??
thanks for the help.
Omar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GreogorianCalendar!? how to work it out
 
Similar Threads
Instance of an abstract class
Abstract Classes
Question about GregorianCalendar class
need to offset a date by intervals of 1 year
Singleton class having a Static declaration in its method which returns its instance