Depricated code on lines 8, 9, and 10, but its only a warning on line 8
Line 8 gets a warning but lines 9 and 10 cause errors. Anyone see a quick fix?
Thanks
Here is the code:
import java.io.*;
import java.net.*;
public class TimeWaster {
public static void main(String[] args)
String url = URLEncoder.encode(args[0]);
String description = URLEncode.encode(args[1]);
String type = URLEncode.encode(args[2]);
URL site = new URL("http://timewaster.net/");
URLConnection connection = site.openConnection();
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(
connection.getOutputStream());
out.println("url=" + url + "&description=" + description + "&type=" + type);
out.close();
BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
Laszlo, wouldnt that only catch a malformed url. not
make it un-malformed? lolyes, but the compiler doesn't know, at compiltime, whether the url you typed is valid or not. so it's forcing you to handle the case where it is not valid.
i personally don't think these checked exceptions are a good idea, but, it's something you have to live with in java.
Similar Messages
-
ALERT to the possibility of bad use of FRAUD in FAKES APPLICATIONS to iPad in iTunes Store. I bought two applications: Word Office, and PowerPoint - $20,00 each-, because the advertising announce it's as Productivity Applications, able to work with them and consequently, to write, to save the works, to print, and else. But it's is ABSOLUTELY FALSE because this FAKE APPLICATIONS only PRETEND to be, but really its contains a BUNCH OF TUTORIALS VIDEOS!!!. So if you need applications to write, a make presentations or else, I strongly recommend PAGES, NUMBERS and KEYNOTE, the Apple applications and your money to be save and guaranteed!. I really think that the iTUNES STORE and the APPLEI STORE must to be policy ALL the applications products BEFORE authorized the sell in his official site!.
Is this one of the apps that you bought?
Microsoft PowerPoint 2010 - Be Expert
It may not be completely obvious, but it is, at least, categorized as Education with an, albeit small, disclaimer "(noted: this app is not the PowerPoint from Microsoft)"
The description is accurate, as it is all "What you can know" and "What you can learn" but they probably should use a different icon to avoid confusion. -
i was working on a project in iMovie (10.0.1) and iMovie just crashed. when i reopened it the project i was working on disappeared. in my list of projects it still says i have 3 projects but its only showing me 2. is there any way i can recover my project?? PLEASE HELP!!!
iMovie on your Mac has nothing to do with iCloud storage. Download and use Find Any File to search for your iMovie project. FAF can search areas that Spotlight can't, like invisible folders, packages and system folders. If there a file with your file name on it anywhere on the hard drive FAF will find it.
Do you have Time Machine enabled backing up to an external HD? This situation is exactly what TM is good at. It makes hourly backups so you can go back to find and restore the missing file. All HDs crash at some time or another and having a good backup strategy is the only protection against that. -
I want to download an album but its only been released on the US site and im in Australia, how do i get it
You can't.
If you have a US-address credit card, you could use it to set up a new account, but you'll runs into all sorts of other problems. -
Hi i just bought tyhe product Export PDFs to Word and Excel . but ni only sussace conver the small file ,the large file such as n3000kb ,it can't work, please tell what can i do now thanks
Hi i just bought tyhe product Export PDFs to Word and Excel . but ni only sussace conver the small file ,the large file such as n3000kb ,it can't work, please tell what can i do now thanks@
-
help, im trying to update my iphone but it kept saying connect to itunes, i have updated, run the file over and over but its still stuck to connect to itunes, wat can i do? thanx
See Here > http://support.apple.com/kb/HT1808
You may need to try this More than Once...
Be sure to Follow ALL the Steps...
But... if the Device has been Modified... this will Not necessarily work -
I am deciding to get CC for photographers package. I already have Lightroom 5 (I bought this separately a few months ago) The photo package includes Photoshop and Lightroom but I only need Photoshop. Would I get a discount if I only need photoshop? Is this a possible option?
There are no discounts. the package is already as cheap as it gets.
Mylenium -
I downloaded fire fox and installed but its not opening after installation
I downloaded fire fox and installed but its not opening after installation. So what should i do?
Hi, tiger's iphone.
Thank you for visiting Apple Support Communities.
Here are the best troubleshooting resources to go through when experiencing issues updating your iOS device over-the-air.
Turn your iOS device off and on (restart) and reset
http://support.apple.com/kb/ht1430
Resolve issues with an over-the-air iOS update
http://support.apple.com/kb/TS4431
You can also update this iPad via iTunes on a computer as an alternative.
Update your device using iTunes
If you can’t update wirelessly, or if you want to update with iTunes, follow these steps:
If you use your device's Personal Hotspot for your computer's Internet connection, update your device wirelessly or connect your computer to another network.
Install the latest version of iTunes on your computer.
Plug in your device to your computer.
In iTunes, select your device.
In the Summary pane, click Check for Update.
Click Download and Update.
If you see an error message while updating your device, you can learn how to resolve iOS update errors in iTunes.
Update your iPhone, iPad, or iPod touch
http://support.apple.com/kb/HT4623
Cheers,
Jason H. -
The reference article in question says "Manually manage music and videos" but I only have the option to "Manually manage videos" via the iPad on iTunes. How do I actually manage music?
Edit: classic Apple.If you post from a a question from the bottom of an article's page then you should get its reference, e.g. HT1535 in your case, on the post's title. The ability to edit you post only lasts for 15 minutes and allows you to correct/add extra info.
I get the 'manually manage music and videos' tockbox as described on that article. If you only 'videos' then are you using iTunes Match on your iPad ? I don't use it but I've seen posts that say having it enabled on a device can affect the syncing of music. -
what should i do please someone help me, I live in UK so how much will it cost to get a screen replacement or will they just replace my phone? but its just my screen so yeah please help. its in a bag of rice and it works fine only the screen is not doing anything and when i press on the screen i see like a white ish blob. will my phone die out or will it just be normal but the screen not functioning
The damage has been done then
Take it to Apple and pay for a replacement
Here in the States a replacement cost $229
Allan -
As captioned, I installed Lion first and then set up the win7 with bootcamp. At the beginning, the defualt system is Win7, I changed as the Lion as the default system in system reference setting. The procedure as follows:
1. Click the system reference setting
2. In the system tool select "Boot Disk", but I only find Macintosh HD Max OS 10.7, no icon for windows 7.
The point is that if I want to change the win7 as the default boot system, what I can do since no icon for selection.Hi,
When you power on your MacBook, hold down the Alt key and you will be given the option of which OS you want to boot into.
Regards -
I assume my Apple TV should allow me to view all events, albums and slideshows in my iPhotos app but it only allows four events and four albums to display on my television. I'm using a Optus mini Wi Fi for my home network. Could this be the reason for limited access via my iMac computer?
ChrisNo, I have not chosen photos to share as I assumed that the Apple TV would access all photos and music that are stored on my iMac.
Thanks for your advice. I will check it out.
Chris -
Is there a format for a file that I can use for attaching a one page document with photos embedded that will open in everyone's email automatically? I've tried PDF and Word, but PDF worked only in Mail. Word worked in nothing. I also tried copying and pasting the document but lost all formatting when just copied and pasted in email. Is there a way to do this?
Are you sure PDF won't work? It should as what you're trying to do is pretty much what it is designed for (PDF - Portable Document Format). On a Mac anywone who receives the file should be able to see it in all its page layout glory by using the app Preview or Adobe Reader. Same on a PC, the file should be viewable as a PDF file using Adobe Reader and probably some other viewer (don't use PCs so not sure what other apps).
What application are you creating the file in and are you sure you're exporting it correctly in PDF format, fonts and images embedded? -
yeah so when those 5 log-ins for diffrent computers, ive used one on my moms laptop, but on my desktop when i restored my computer to get rid of a virus it took one and sometimes when windows updates it kicks it off so now my five are used up and i have like 1000 songs i cant play out of my library so like can i get some more log-in thingys or what??
Hi, this is a user support board, apple employees don't post here. Just mentioning that since your message sounds like you thought you were writing to someone who can give out apple thingies
Deauthorize your desktop over and over, since you say it is using more than one authorization. Here is an articel on that:
http://support.apple.com/kb/HT1206
If that doesn't work you can use the "deauthorize all" method once per year, which is explained here
http://support.apple.com/kb/ht1420 -
I am unable to download any apps as it says it needs my special code from my card id but it says its currently unavailable. What should I do?
Try here:
iOS: Troubleshooting applications purchased from the App Store
Maybe you are looking for
-
Unable to extract data from an AS/400 system.
Hello experts. We are trying to extract data from an AS/400 system but not having any success until now. I´ll write down you the stepts that we have followed until now: 1.- Create a DB Connect between both systems 2.- Create a Source System from AS40
-
Using jms names with a / in it...?
With the following wlst-code I try to create a Jms Uniform Distributed Queue thru wlst. def createJmsUdq(qName,sysName): print 'INFO: createJmsUdq '+qName cd('/') cd('/JMSSystemResources/'+sysName+'/JMSResource/'+sysName) cmo.createUniformDistributed
-
Help undeploying an incorrectly deployed application
Hi, I deployed a J2EE application to my Application Server PE 8.2 from Net Beans IDE. Even tough all seemed to be ok, after viewing the server log I found out that the deployment didn't complete successfully because of a timeout error. Since then, af
-
In using FB4.6 with AIR 3.4 for iOS on Mac OS X 10.7.4 and when I run this on an iPad 2, one of my views is taking 3.2 secs before it's displayed. I've search for references to things to do to improve the performance I have a View containing a Tabbed
-
CS3 on macbook pro 10.8.5
I have CS3 which was transferred onto a macbook pro 10.8.5. Photoshop is now acting independently, giving me grey when I select red, rendering all numbers in the type tool in italics. any advice? Thanks!