Results 1 to 7 of 7
Thread: Can you overwrite a String?
- 05-07-2012, 08:08 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 26
- Rep Power
- 0
Can you overwrite a String?
I am making a password system, and I want to overwrite a string.
First I enter the pin and is saved into a String, and when I save a new password, I want it to overwrite the same String.
For example if I saved '123' into savedpassword=""; , and if i enter a new password, will it overwrite it?
Is this possible?
Sorry, if i am asking a dumb question.
Thanks.
- 05-07-2012, 08:20 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,619
- Rep Power
- 5
Re: Can you overwrite a String?
Did you try it? What happened? Often it is useful to write up a small test program to demonstrate to yourself, one way or another, a particular functionality such as this.For example if I saved '123' into savedpassword=""; , and if i enter a new password, will it overwrite it?Last edited by doWhile; 05-07-2012 at 08:22 PM.
- 05-07-2012, 08:22 PM #3
Member
- Join Date
- Nov 2011
- Posts
- 26
- Rep Power
- 0
- 05-07-2012, 08:40 PM #4
Member
- Join Date
- Nov 2011
- Posts
- 26
- Rep Power
- 0
- 05-07-2012, 09:42 PM #5
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,619
- Rep Power
- 5
Re: Can you overwrite a String?
Glad you got it...for what its worth overwrite is incorrect terminology - the first variable is a reference to a String object, and you reassign that reference to another String object.
For your other question, I suggest posting a new question and include an SSCCE/code that demonstrates what you have...as we have no clue how you are receiving 'keypad input'.
- 05-07-2012, 09:44 PM #6
Member
- Join Date
- Nov 2011
- Posts
- 26
- Rep Power
- 0
- 05-08-2012, 02:18 AM #7
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,619
- Rep Power
- 5
Re: Can you overwrite a String?
Well then, best of luck. But let me say this: that's one advantage of an SSCCE - its not a code dump, which will often do little to help you get an answer any faster, but a quick and boiled down example of the question you are asking. Google the acronym to learn what it truly is
Similar Threads
-
pdfbox to overwrite image on a pdf
By vammpiro in forum Advanced JavaReplies: 1Last Post: 03-09-2012, 03:54 PM -
to overwrite with showSavedDialog!!!
By DarkGhetto22 in forum New To JavaReplies: 2Last Post: 06-27-2011, 06:25 AM -
[SOLVED] Overwrite text file line with output stream loop
By jenni in forum New To JavaReplies: 3Last Post: 02-16-2009, 09:20 PM -
file overwrite method
By nanaji in forum Advanced JavaReplies: 5Last Post: 11-14-2008, 09:19 AM -
Create and overwrite files
By wmrwl in forum New To JavaReplies: 7Last Post: 10-01-2008, 04:16 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks