Converting numerous strings to one string - any ideas how to do this?
Hi,
I've written a test main class where the user inputs, via the keyboard, one integer value and four strings. I've already converted the one integer to a string value, but I now need to convert all of the strings to one string
Does anybody know how to achieve this?
Many thanks!!
Thanks for the reply.
How do I change the saveTo method so it will add commas to the String filmDetails in the constructor within the class Title?
I don't understand what you mean when you say that I write to one file and read back from another. In my main class I'm only reading and writing to one file, as follows,
import simplejava.*;
import videos.*;
import java.io.*;
public class AddTitle {
public static void main(String[] args) {
String film, actor1, actor2, director, title;
int codeNum;
SimpleReader keyboard = new SimpleReader();
SimpleWriter screen = new SimpleWriter();
SimpleReader inFile = new SimpleReader("title_test.txt");
//title = inFile.readLine();
//String[] myStrings = title.split(",");
TitleList titles = new TitleList(inFile);
codeNum = keyboard.readInt("Title Code for the Film");
int intValue = codeNum;
String stringValue = Integer.toString(intValue);
film = keyboard.readLine("Film Title?");
actor1 = keyboard.readLine("Lead Actor?");
actor2 = keyboard.readLine("Supporting Actor?");
director = keyboard.readLine("Director?");
String videoTitles = film+actor1+actor2+director;
titles.add(new Title(codeNum, videoTitles));
screen.println(titles);
SimpleWriter outFile = new SimpleWriter("title_test.txt");
titles.saveTo(outFile);
outFile.close();
}In the main class I thought I was closing the file with the code,
outFile.close();Any ideas how to solve these problems?
Similar Messages
-
I updated to the latest iOS and now YouTube and the Ap store are no longer on my phone. Also, not all my music will play and if I play a song it will actually play a different song while displaying the one I chose. Any ideas how to fix this?
You have to download the individual youtube app now. It is no longer a nataive ios app from apple in ios6
-
Hello, I have transferred my Acrobat XI Pro from old MAC to the new one. After the transfer can not open any PDF file. Any idea how to solve this?
Hey ilyaz20360341,
Could you please specify how exactly did you transfer Acrobat from one MAC to other.
You might need to deactivate the software from your old machine and then activate it on the new one with the same serial number (for Acrobat license) or Adobe credentials (for Acrobat subscription).
If you have done the same way, then let me know if you are able to open Acrobat itself.
Do you get any specific error message while opening a PDF?
Hope to get your response.
Regards,
Anubha -
In my email all the messages from one person bunch together and I would like to separate them. I have done this before on my iPhone but just recently got an iPad and its doing it on this, so does anyone have any ideas how to fix this issue?
Settings >> Mail, Contacts. Calendars >> Organise by Thread. Switch to OFF to see every individual email in the Inbox.
-
HT1338 Any one have any idea how to hide unwanted updates in OSX Mountain Lion? Many thanks
Any one have any idea how to hide unwanted updates in OSX Mountain Lion? Many thanks
Captfred,
Thanks for the suggestion, unfortunately no hide option is available by right clicking the Motion 5.0..4. update.
Seems strange that this does not appear to have been included, unless I'm missing something. -
I followed the instructions given to turn my automatic download icon in my iphone 3 and still goes back to off position. Any idea how to fix this issue without getting a new one?
Something may have gone amiss on your iPhone.
To attempt to correct this follow these steps:
Backup your iPhone using iTunes or iCloud.
Use iTunes to completely restore your iPhone as Factory new.
Monitor battery usage to see if it is normal. If not, you may have a hardware problem - if so, contact Apple support.
Restore your iPhone from your backup above.
Check battery usage to confirm that it is still normal. -
I have music in the cloud but only plays one at a time, anyone have any idea how to solve this please?
- Transfer iTunes purchases by:
iTunes Store: Transferring purchases from your iPhone, iPad, or iPod to a computer
- Transfer other music by using a third-party program like one of those discussed here:
Copy music from Ipod to new computer...: Apple Support Communities
You may have t opurchase one. Some only do a limited number of transfers without paying.
- Make a backup of yur iPod by connecting the iPod to the computer and right clicking on the iPod under devices in iTunes and selecing Backup.
- Restore the iPod from that backup. -
my iphone went into recovery mode for some reason and is unable to be restored. it wont turn on and when plugged into a charger it shows a usb and itunes symbol. so i plugged it into my mac and connected to itunes then itunes said it has detected a phone in recovery mode and needs to be restored. so it goes through the restoration process for a couple minutes or so then stops and says itunes is unable to restore because an unknown error occurred (2001) or (2006) and other times i try it says its unable to restore because itunes cant detect the device... any ideas how to fix this?
Errors 2000-2009 (from Apple support): If you experience this issue on a Mac, disconnect third-party devices, hubs, spare cables, displays, reset the SMC, and then try to restore. If you are using a Windows computer, remove all USB devices and spare cables other than your keyboard, mouse, and the device, restart the computer, and try to restore. If that does not resolve the issue, try the USB issue-resolution steps and articles listed for Error 1604. If the issue persists, it may be related to conflicting security software.
2001: Use up to date software. Make sure your device is in DFU Mode: http://www.iclarified.com/entry/index.php?enid=1034
2006: Use a different USB cable. Possibly the one that came with your iPhone. -
My mail will not delete. When I move it to trash and then delete it, within a few minutes it has all bounced back in again. Checked my preference settings and all seems to be in order. Any ideas how to resolve this frustrating problem?
That sounds like a compatibility issue with an add-on that you have installed, as reported by a number of users in both Firefox 22 and Firefox 23 over the last couple of months. If you would provide a listing of your installed extensions ''(as you were prompted to do when creating this thread)'' maybe one of us can advise you which extension is the mot likely culprit. You will need to re-install Firefox 23 to do further diagnostic testing.
As far as the compatibility of Firefox 23 and Win XP SP3, Mozilla has verified they are compatible and not one user ''(including me on two separate PC's)'' has reported a problem with compatibility. -
Hi, my facebook app on my Ipad3 has stopped allowing me to put comments on. Does anyone have any ideas how to correct this? Don't know if it is a problem with the Ipad or just the facebook app. Thanks.
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
http://tinyurl.com/32drz3d
I saw one post where a user said dust got inside the small microphone hole. Using a vacuum cleaner removed the dust and restored the audio.
Cheers, Tom -
HT204389 siri quit working in notes. Any ideas how to fix this problem?
Siri quit working in notes. It still works from the main screen.Any ideas how to fix this problem?
Yes I do spend a lot of time in China but I have had problems in other countires as well. I am in China right now.
I have two Gmail accounts and one Cox account. Cox is my intranet provider back home. I have had problems with all three accounts.
I have tried several outgoing port settings. 993, 995 465, 587 are some that I can remember trying.
Sometimes my accounts will go offline without me doing anything. This is all a mystery to me. I don't have any idea why I have trouble like this. A few minutes ago I changed my Cox account outgoing port and took the account on line and I got my incoming email but when I tried to forward an email that I got it would not go out.
Any ideas you have would be helpful. -
My clips don't appear. They appear as blue boxes.
I have to click through them to reveal them each time I need to do an edit... which slows up the process on a big edit right now.
Any ideas how to fix this?
With thanks,
SteveI may have solved my own issue. I clicked on one of my clips (or you can click on all your clips for that matter) in the event browser, opened the inspector tab and clicked on the 'Info' tab, then the 'settings' drop down at the bottom of the inspector window. I then clicked on 'apply custom name' and then clicked 'original name from camera'.
So far all my thumbnails are visible and I've been working for 1hr since my last post with no thumbnails going BLUE on me. They are all still visible. Give it a try and let me know if it works for you.
Best Regards. -
My iPhone 4s calendar doesn’t have an add “+” button so I’m unable to create calendar items… Any idea how to fix this?
Sounds like a hardwware problem.
Make an appointment at an Apple Store if there is one nearby to confirm. -
Hello I have just updated my iphone 5 and it keeps requesting 2 old email addresses from I quests my old laptop any idea how to stop this ? Thanks
Log out of the old ID, then login using the new one with the correct pw.
-
Safari status bar disappears. I have tried clicking on show status bar, under the View tab and it will only appear when I move the cursor to the top of the screen. I can not minimize the open page, only full screen or close the browser. Any idea how the rectify this issue?
One enters and exits full-screen with control+command+F keys. This is on the View menu in Safari. Optionally, the green traffic light in your browser title bar, if you roll over it, has the full-screen control it it. While in full-screen mode with Safari, moving your mouse pointer virtually up, and off-screen reveals the Safari title bar again, and you can click the green traffic light to exit full-screen mode.
You can hide/show the status bar by simply typing command+/. This too, is on the Safari View menu. and in 10.10.1 — it works reliably for me.
Maybe you are looking for
-
Hi all- Is there any function module which can be used to do payment run steps of F110 transaction? thanks in advance
-
Can't submit feedburner podcast to itunes
Hello, I have created a feedburner podcast to submit to Apple. The podcast can be subscribed and downloaded manually in iTunes. However, there is a time out issue when trying to submit the podcast to iTunes. I have trie to submit this podcast to Appl
-
Hi all, I have to implement the Steganography using Java, i have to get two images and have to hide one image in another , please give me some ideas or sample links where i can explore to implement it... Thanks & Regards, Justin
-
is it possible to order square prints or any size not offered on the standard Apple prints ordering menu? If not and I crop a photo to square, how can I order it then?
-
Sudden Problems moving files on External HD
I have a Seagate Goflex 1TB external harddrive that I've been using for a few weeks. Suddenly, tonight the hd stopped letting me move files with the hd or to or from my macbook. I can still delete files though. It's been working fine since I got it a