Results 1 to 1 of 1
- 12-14-2009, 02:05 AM #1
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
topic is for errors and questions i get throughout my work
Hello. I'm working on an app and im using the app in this link as my starting point. I'm trying to understand some things and using what I see as reference to my own work.
So to start with, here are some questions!
h**p://w*w.java2s.com/Code/Java/J2ME/AsimpleclassthatshowsvariousfunctionalityofRMS.h** (htm)
Look for this line RecordStore.deleteRecordStore(name);
The comment says that any previous record store wiht that name is to be deleted. If it fails then we ignore it. I assume it means if that recordstore name isnt found then just catch the exception without any msgs and move on.
My question is this: WHY? why r they deleting it?
Also, look for Don't allow this class to be instantiated
He's explaining what the private does i believe so that we can't create objects of it because i believe when you create an object of a class, it goes to the constructor and initializes it there. But why did he make it private in the first place? All this class does is create a RecordStore. The address book. The object that holds all the data. For security reasons? Or?
And why does he include the boolean values? Why is the create method boolean? Here's a rookie question.
Line 136 take you to Line 352. In the midlet's construtor he calls a method in a different class by type class.method(paramenters). At line 352 you see that this method returns boolean. He even says it in his comments. False if the record wasnt created. Well why? What happens if i removed the boolean and return statements. Whats the significance? I mean, here's the rookie part .. hope not, line 136 should have Boolvar = CreateAddress.recordstore(parameters); If the method returns a boolean then it should b saved in a boolean variable. But he doesnt do that here. So once again, whts the significance of having all a boolean return type if ur not going to do anything with it.
Similar Threads
-
How to purge or Delete messages from ActiveMq Topic
By gupta.asheesh22@gmail.com in forum Forum LobbyReplies: 0Last Post: 11-26-2009, 09:50 AM -
Question on Object Orientation Topic
By DrMath in forum New To JavaReplies: 1Last Post: 09-29-2009, 07:07 PM -
What is the difference between Semantic Errors and Logical Errors?
By tlau3128 in forum New To JavaReplies: 3Last Post: 03-08-2009, 01:51 AM -
How to publish jms topic on server
By pankaj_salwan in forum Advanced JavaReplies: 0Last Post: 10-06-2008, 09:59 AM -
Interesting topic in JComboBox
By success21061985 in forum NetBeansReplies: 0Last Post: 08-21-2008, 12:43 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks