How do you check if the input is empty?

Hello,
I am asked to write a program which gets as input in the command line a number of strings, and is to print out the first of these string.
but if the input is empty it must print our an error message.
how do i check if the input is empty?
i guessed
public static void main (String[] args){
     if (args == null)
     ........but thats wrong.
Thanks,
iris

If no arguments were passed, it means that there are zero arguments entered. So the args array will have a length of zero.

Similar Messages

  • Using PL/SQL Block how do you check if the character string value is aA-zZ

    I have a pl/sql block that I prompt the user for password and I load the string into an array and interrogate each index(entry) to see if it is "aA-zZ".
    How can I check if the value entered is Alpha.
    I need to do the same for number and Special character. Please advise. Thanks

    Thanks to All of you. The desired solution to verify complex password that enforces desired security policies. An example that I am using is the following:
    IF NOT (regexp_like(sz_complex_pw,'[[:digit:]]') AND regexp_like(sz_complex_pw,'[[:alpha:]]') AND regexp_like(sz_complex_pw,'[[:punct:]]') AND regexp_like(sz_complex_pw,'[[:upper:]]'))
    THEN
    --dbms_output.put_line('Password is not complex...');
    RAISE sz_err_pw_complex; -- Complex Password is not compliant
    END IF;
    DBMS_OUTPUT.PUT_LINE('Complex Password is in Compliance...');
    EXCEPTION
    This was helpful to me and I trust others will find helpful.
    Edited by: yakub21 on Oct 16, 2010 9:05 PM

  • How do you check if the replacement phone is a refurb or new one ?

    Hi Guys
    Can anyone tell me what does the Facotry code 70 stands for ? because I am getting a replacement phone and I see that the Serial number starts with 70.
    when I checked in the below site.. its not giving me any information about whether refurbished or new one ?
    http://www.chipmunk.nl/cgi-fast/applemodel.cgi
    this is the serial they gave me....70116***A4S
    BUt I am not able to find out the waranty status or anything about this phone.. Do I need to activate it first.. so that it gets reflected in Apple site and then I get details ??
    My Earlier phone serial starts with 79 (this is manufacutred in china) am curious to know what does the factory code "70" stands for... hope this is not for refurbished.

    As I said, you walk in and put an ultimatum to them and they will happily give you your money back. But they can't do anything about the ETF and won't try. That's for you to sort out with the carrier
    And even if they refuse, you go ahead and try that consumer complaint. You aren't likely to get very far on that route. Because the first thing the Apple lawyers will do is ask for the paperwork from your appointment so they can see where you signed the bit about "I understand and accept the terms of service". They can't be held accountable for you signing something you didn't bother to read. But you can be held to the terms, which include the sources for replacements and the possibility of receiving a refurbished product. So again, the best you might get is your money back from Apple. But you will still be out the money from the carrier if you are under contract.
    And yes it will most likely be your money and not a new phone. Why? Because Apple has millions of customers they don't need a douche acting one like you so they will happily pay you back your money and send you on your way.

  • How do you check if the attachment Link Bean is going to return "None" or .

    Hi to All,
    What attribute could i check if the attachmentLinkBean is going to return "Attachment List" or None?
    I've checked the TEXT_ATTR but it always return "Attachment List" no matter what. Hope to hear
    some opinion on this. Thanks in advance!
    Greg

    Greg,
    I am not sure you can get at that directly. However if what you want to do is determine if there are any attachments for the record, then you can setup a VO with bind parameters querying APPLSYS.FND_ATTACHED_DOCUMENTS passing the ENTITY_NAME, PK1_VALUE ... PK5_VALUE for that record and if you get zero records in the query, it was "NONE", otherwise you have attachments.
    Hope this helps.
    Kristofer

  • How do you check the existance of a file in Linux?

    Hi,
    How do you check to see if a file in certain directory exists?
    I'm trying something like.
    if [ "ls fhs_jwesha_2.log" ]; then echo Here; else echo Not Here.;fibut I know that's not the right command.
    Anybody?

    Assuming from command line:
    [user@myhost /]$ [ -f /etc/passwd ] && echo "here" || echo "not here"
    here
    [user@myhost /]$ [ -f /etc/no_file ] && echo "here" || echo "not here"
    not hereFor a script, try:
    if [ -f /etc/passwd ]; then echo "here" ; else echo "not here" ; fi-troy
    http://troysunix.blogspot.com

  • How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text?

    How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text? Please help! I'm technologically challenged.

    Most forms (99% or more) are created for simple text input, where you cannot change anything.
    The creator of the form could allow Rich Text input (which allows you to change font, text size, color, etc.), but frankly I have never seen such a form, and I wouldn't know how they look.  But I'm sure they would show some kind of controls to alter the text appearance.

  • How do you check Memory Speed on ICD

    Hi everyone
    I am new to the forums and I am also a soon to be first time mac owner(Receiving my 20" ICD this week) .
    I am buying the imac with an extra 1gig DIMM installed, non-apple memory.
    Now the reseller assures me that the 3rd party memory that he'll be using is compatible with the imac.
    I'm assuming that if there are no issues at start-up then the memory is compatible, but I would like to know how can I check that the memory is running at 667 mhz and that he did not install 533 mhz memory.
    So how can I check that the memory is running at 667?
    Thank you in advance
    20" Imac ICD     1.5ghz memory

    Ah, I think I'm reading that you may be concerned about a potentially counterfeit SO-DIMM. That's one reason to buy direct from a reliable seller such as Apple or Crucial. I'm not sure the memory utility Memtest will verify the DIMM's speed, but it will verify whether or not the SO-DIMM is working properly. That might include a speed calculation, and possibly you can email the Memtest author to find out.

  • TS4425 How do you agree to the latest iCloud Terms of Service if you don't have an iOS device only a Mac computer and an Apple TV with an iCloud account?

    How do you agree to the latest iCloud Terms of Service if you don't have an iOS device only a Mac computer and an Apple TV with an iCloud account?

    Part 2
    Thanks for the feedback Skhorchid.  Glad it worked for you too.
    A bit later I discovered that Photo Stream was not working on my Windows 7 PC either.  If I opened the iCloud control panel and put a check in the box to turn on Photo Stream, and then closed and reopened the control panel, the check mark was gone again.  Also, nothing happened when I clicked on the options button beside the Photo Stream check box.  I already had version 2 of the iCloud control panel so I could not upgrade further. 
    I ended up uninstalling the iCloud control panel, rebooting, downloading a fresh copy from Apple, and reinstalling it.  This worked and I now have photo stream working on my Windows 7 system as well.

  • How can you check a different iCloud account in safari in an iPad?

    How can you check a different iCloud account in safari in an iPad?

    As currently designed, you cannot. Once iCloud detects you are on mobile Safari, it switches you to the iPad screen.
    If you had another browser that would allow you to pretend you were a desktop Safari client, ie8 or 9, or Firefox, that might work.
    But, Puffin and Opera mini don't work.
    Gary

  • How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    An alternate method is Accessibility Settings when connected to iTunes. You should be able to turn it off there. I would also check out some of the answers listed to the right of this post and see if they can help.

  • I had bought a Mac PRE 13 in,  in 7th Sep,but it is 15th Sep today,how doesn't my computer come to me? So,how can I check where the computer is at this moment?

    I had bought a Mac PRE 13 in,  in 7th Sep in the online Apple Store,
    but it is 15th Sep today,how doesn't my computer come to me yet?
    So,how can I check where the computer is at this moment?

    Call the online Apple Store.  You should have received an email with a FedEx tracking # if you are in the US.
    There is nothing anyone can do for you on a message board!  We are all end users just like yourself.

  • How do you check your dedicated GPU is working?

    How do you check your dedicated GPU is working?
    Some strange things have been happening since my MBP (2009, SSD, 8GB, 17") was updated to Lion:
    1. Icon images load slower than usual, e.g when opening the applications folder the images take a fraction longer than would be normal
    2. If re-naming a folder, you see the new title, then the old one, then it switched back to the new one.
    3. When playing HD video, or rapid desktop switching the picture looks split in two.
    I checked that my GPU was on dedicated, but it had changed back to Intel integrated? Then a re-start and I checked it was on dedicated GPU, which it was BUT the above problems still remain.
    Plugged in a 24" LED Display via display port and it does not come on - only the USB ports work. Does a display need a dedicated GPU to work?
    Zapped Parameter Ram, rebuild permissions, and reset SMC all to no avail. Techtools pro 6.0 finds both cards but can't check them. I assume its not Lion compatible yet?
    MBP is still under Apple Care, but I want to know if I can identify the problem is the NVIDA GPU. But how?
    SBB

    Disconnect other hardware
    Run a hardware test & safe mode see if it goes away
    Safe Mode
    http://support.apple.com/kb/HT1455
    Reset SMC
    http://support.apple.com/kb/ht3964
    PRAM/NVRAM
    http://support.apple.com/kb/HT1379
    Hardware Test
    http://support.apple.com/kb/HT1509
    Backup files to a exteranl drive and disconnect , c boot off 10.6 installer disk and simply over-install OS X onto the installe version run the Combo Update
    http://support.apple.com/kb/DL1399
    That should take of the faulty driver if there is one.

  • Why has iTunes seperated a album which I have copied over from my external hard drive into iTunes? How can you pull all the songs back together into one album again?

    Why has iTunes seperated a album into indevidual songs, which I have copied over from my external hard drive into iTunes? How can you pull all the songs back together into one album again?

    Steve MacGuire a.k.a. turingtest2 - iTunes & iPod Hints & Tips - Grouping Tracks Into Albums - http://www.samsoft.org.uk/iTunes/grouping.asp (older post on Apple Discussions http://discussions.apple.com/message/9910895)
    Quick answer:  Select all the tracks on the album, File > get info, and either give them all a single "album artist", or check the "compilation" flag (as in https://discussions.apple.com/message/17670085).
    If these are from multiple-CD sets you may also need to enter the appropriate information in the disc number fields.  If they are not a multiple CD set you still need to make sure the disc number fields are set correctly or all empty.

  • HT1766 I have manually back up my iphone few days back, and my contact got missing the next day. i restored my back up from iTunes, however, my contact did not get restored. How do i check if the manual back up did actually back up my contact or not?

    I have manually back up my iphone few days back, and my contact got missing the next day. i restored my back up from iTunes, however, my contact did not get restored. How do i check if the manual back up did actually back up my contact or not? How do i get back my old contact in my phone?

    Your entire second paragraph is so confusing I am going to ignore it.
    But I may be able to answer your first and third paragraphs, which seem to address the same question.
    I wonder where your iPhone states it was backed up yesterday.  I am going to assume that you see this under Settings > iCloud > Storage & Backup.
    If that is true, then the backup from yesterday is in iCloud.  The one and only way to restore an iCloud backup is to do this on your iPhone:
    Settings > General > Reset > Erase All Content and Settings
    That will cause your iPhone to begin a setup process.  As part of that process, assuming you enter the same Apple ID you used when you created the iCloud backup, you will be offered the opportunity to restore from it.

  • How do you know if the Maverick download is happening?

    I am now trying to download Maverick .. & have been hearing a whirring sound. But it starts then stops?
    - BUT I can't tell if it's done. I've kept the "page" on the screen, and the "download" button shows grey & it shows "Downloading"
    - BUT I don't see any circles, to show anything is happening.
    - NOR can I see anything on download in Finder. I've been checking the apple icon to see & it still shows Lion, 10.7.5 that I got in 2012. I have 4GB.
    So, How do you know if the Maverick download is happening - & when it's done?
    Last, do you have to restart the computer? I haven't been able to find a "how to" about this download.
    Thanks

    With App Store open, purchases or updates pane (can't recall which), CMD+R to reload the page, and you should see a progress bar. Should look like this:

Maybe you are looking for

  • Sales order item report based on results analysis key and status

    Hi, I am trying to find a a report to generate list of sales order items with following selection         -invoicing status -invoiced/not invoices (other status)         -result analysis key assigned to this item (VBAP-ABGRS)         -system status /

  • How to I add an email address (not from incoming message) to an existing contact?

    I noticed that none of the discussions on how to add an email address to a contact in Contacts focuses on an email address you may have been given which you want to manually add to an existing contact. Any idea how to do this?

  • Why is this so hard to use?

    All the iLife software is a breeze to use. My grandmother can even manage her pictures and music using iTunes and iPhoto. So why is GarageBand so freaking complicated. I have no idea how to do anything in it. Earlier, I wanted to create a dance beat

  • How do I add a second ip subnet to a hypervisor?

    I am running oraclevm server 2.2.2 on a leased server that came with a /29 ip subnet. Needing more IPs, I asked the provider for more and they gave me a distinct /28 to use. Is there a way to bind this to the same eth0 via a second xenbr interface or

  • NoSuchMethodError: oracle.jbo.mom.xml.DefElementImpl

    Oracle Folks, I got this NoSuchMethodError on new AIX server, but it works fine on current AIX server. Does anybody knows which library file is related to oracle.jbo.mom.xml ? Am I running with wrong library file? Thank you for your help. Oracle Ente