Promo Code Forums » Tracfone Forum

In j2me i don't seem to be able to use the scanner class?!?

(2 posts)
  1. jack8888
    Member

    when i make a class to create a dictionary using the scanner class from java.util package, and make an object of that in a j2me midlet i get the error message stating that the class scanner is not found!!(i imported all the necessary packages)

    Posted 2 years ago #
  2. ping333
    Member

    All we ever need to do to actually use the various methods of the SimpleSingleton class is to access the static instance member and use it to invoke our method of choice, like this:
    SimpleSingleton.getInstance().doSomething();
    With such a class, we never need to create and store the SimpleSingleton instance object anywhere, or worry about passing the object reference around.
    Singletons in Java 1.0 and 1.1
    All Java specifications require us to keep a reference to the singleton object, or lose it to the garbage collector. But, in pre-1.2 Java specifications, the garbage collector was not only free to collect the singleton object but also the SimpleSingleton class! . This garbage collection of an actual class is also known as "class unloading."

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.