How to find out if all the characters in a string are digits?

Hi, I want to write a program that is boolean & it returns true if all the charactrs in a string are digit. i have written a prgoram which returns true if String has digits where as I want it to return true if whole string is digit. can anyone help please?
public class stringD {
          //construct String
private String str;          
public boolean isDigit (String str) {
boolean answer=true;
for( int i = 0; i < str.length(); i++ )     {
     if( str.charAt( i ) < (int)'A' )     {
          answer=true;
     else {
          answer= false;
     }//if & else
}//end for
return (answer);
}//end boolean
public static void main (String [] args)     {
          stringD str = new stringD ();
          System.out.println("String is Thank you 1234");
          System.out.println("If all the characters in string are digits. It will be true: " + str.isDigit("Thank you 1234"));
} //end main

boolean b = true;
for (int i = 0; b && i < str.length(); i++) {
  if (str.charAt(i) > '9' || str.charAt(i) < '0') {
    b = false;
if (b) {
  System.out.println(str+" is a number");
} else {
  System.out.println(str+" is not a number");
}

Similar Messages

  • HT201359 how can i find out what all the charges on my checking account are for?

    how can i find out what all the charges on my checking account are for?

    If you log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it. Click on that and you should then see a list of your purchases - the most recent purchase is above the list. I'm not sure if that shows auto-renewing subscriptions (I don't have any so I can't check).
    If you can't find the charges and you haven't added or changed your card details on your account (when you do then a small temporary store holding charge may be applied to check that the details are correct and valid, which should disappear within a few days) then you can contact iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How to find out what is the lock key for the computer

    How to find out what is the lock key for the computer?

    You don't.
    If you forgot or lost the password, all you can practically do is reset it.
    The manner in which you do so depends on what version of OS X you are running. The older versions utilize the reset password utility on your recovery/re-installation disk/drive.
    On Lion, you use the following technique to reset the Administrators password:
    Boot to your Lion Recovery Partition, by holding down the Option key while starting, and then selecting the Recovery HD as the boot choice.
    Once booted, at the top of the screen is a menu ..., select Utilities / Terminal from the menu bar.
    In the Terminal window, type “resetpassword” (without the quotes) and press return. A “Reset Password” window will open. Select your boot volume (your SSD drive) if it is not already selected. Select your administrators username from the menu labeled “Select the user account” if it is not already selected. Follow the prompts to reset the password. Restart the computer from the apple menu.

  • How to find out  Locks on the database objects

    how to find out Locks on the database objects

    The following notes should be helpful:
    Note: 200590.1 - bde_session_locks.sql - Locks for given Session ID
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=200590.1
    Note: 1039273.6 - SCRIPT: VIEWING LOCKS ON OBJECTS HELD BY SPECIFIC USER
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1039273.6
    You can also search Metalink, there are many notes/scripts published there which would be also helpful.

  • How to sign out of all the devices that have my apple id

    How to sign out of all the devices that have my apple id?

    For example: on an iPhone, go to Settings > iCloud, then tap Delete Account.
    "Deleting" the account is a bit of a misnomer because that action only deletes the account from the device. It can just as easily be added again. It is not possible for users to delete their iCloud account from Apple's records.
    For a checklist of all the Apple products and services that use your Apple ID refer to this document.

  • How to find out tcode for the zprogram.

    Hi All,
    How to find out the Tcode of a Zprogram.
    I will appritiate your help.
    Thanks,
    Veni.

    Couple of ways to do this,  one is to go to SE93 and do F4 on the transaction code field, click information system,  click the all selections icon, then put the name of the z program in the field, and hit enter,  this will give you the tcode.
    Regards,
    RIch Heilman
    Message was edited by:
            Rich Heilman

  • How to find out which was the last Function Fired in a given schema ..?

    Hi All ,
    Suppose there is a function called track_account (Accnt_id, bank_name ...)
    I have a requirement wherein I need to find out when was the last date when this function was called , by which user and what was the parameter list that was passed .For example i this case - what accountid and bank_name combinations were passed .
    I know the information is stored in one of the V$ tables but am not able to locate the exact table and column that would give me this information .
    Please suggest .
    Edited by: user3481493 on Mar 8, 2010 10:58 PM

    amol_dev wrote:
    Thank you for your reply Brynjar.
    However, I was trying to figure out a way to do this without having to change the calling command line, because due to legacy reasons, it is not possible to change the command line calling the parent applications of this common code.You cannot change the command line, but you can change the applications?
    In main() do this:
    System.setProperty("whoami",(new Throwable().getStackTrace()[0].getClassName()));Elsewhere:
    String whoami = System.getProperty("whoami");

  • How to find out who deleted the central person ID of a pernr.

    Hi,
    I have a pernr 100 whose central person ID is deleted. I would like to know how can i find out who deleted it. Which table gives this information.
    Thanks & Regards,
    Soumya.

    It is stored as a relationship in HRP1001 & unless you have table logging turned on for this db table, I don't think you will be able to find out who deleted the Central Person. You can try running the Report RHCDOC_DISPLAY .
    ~Suresh

  • SQL Server Software ISO, How to find out what is the Edition and Version of the SQL software before starting installation

    Hi All-
    Before starting installation, I would like to find out What EDITION and VERSION  is the SQL Server Software ISO.
    Please note this is not to find out what version is the installed sql server but before the installation: Is there a note or abrv. that describes what kind of Edition and version is the ISO?
    Detail explanation is appreciated.
    Thanks.
    belayzeleka

    @Balmukund - Thanks for the input - That one is a nice blog!
    But assuming you can`t change the Product Key value (you are not provided that number, as you know it gets populated by itself) can you find out
    what implies the corresponding edition? If there is a folder where this reference is store, could you provide the full file path where  this folder is located?
    The ideal solution would be a way to find out what the Edition
    is befor we start installation.
    Thanks!
    Also just to add what I came across:
    The SQL Server 2012 installation software comes with pretty much all edition in it, that kind of makes it difficult to easily identify what edition is the specific ISO, but when
    one downloads from MSDN one must downloads the
    right edition either Standard,
    Enterprise, etc so that when you install it, it installs whatever edition is downloaded.
    The best source would be whoever downloaded the software.
    Also, before going too far, you can find out what edition it is being installed right before the setup wizard finishes on the
    License Terms page (Microsoft Software License Terms Page) and if the edition is not the one you intended to install, you can cancel it there and everything will be rolled back- no hastle.
    belayzeleka

  • How to find out, who locked the same row

    Dears,
    I have a problem,
    sometimes our user complain that, when he tyring to make a transaction to a specific customer's Account
    its says 'Some other user access the same account, keep trying...' (like this).
    and in this response I just kill that user's session. then he can make the transaction by reconnecting.
    sometimes my solution(killing the session) can not slove this problem.it stayed even 5/6 hours long.
    in this time,i cannot find any bloking session or such a long waiting session.
    In this Scenario..
    I need to find out who(SID,SERIAL#,USERNAME) locked the same ROW (not table).
    There are many users who are locking different rows of the same table at the
    same time. I need to find the one who locked my row.
    is it possible to find out, who locked the specific customer's Account ?
    I am trying to find out by the following query but failed.
    SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
    row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
    DBMS_ROWID.rowid_create (1,
    row_wait_obj#,
    row_wait_file#,
    row_wait_block#,
    row_wait_row#
    ) rowidd
    FROM v$session s, dba_objects b
    WHERE s.row_wait_obj# = b.object_id
    SELECT *
    FROM (SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
    row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
    DBMS_ROWID.rowid_create (1,
    row_wait_obj#,
    row_wait_file#,
    row_wait_block#,
    row_wait_row#
    ) rowidd
    FROM v$session s, dba_objects b
    WHERE s.row_wait_obj# = b.object_id)
    WHERE rowidd IN (SELECT ROWID
    FROM account_mas
    WHERE branch = '999' AND accout_no = '009990215454')
    please help me...
    My Database version- 10.2.0.4, windows
    Regards
    Halim
    Edited by: Abdul Halim on Oct 26, 2009 2:43 AM

    Just check with this query, find the lock and kill the session.
    select b.session_id ,a.SERIAL#, a.username "Blocker Details"
    from v$session a,dba_lock b
    where b.session_id = a.sid
    and b.blocking_others = 'Blocking';
    Regards
    Asif kabir

  • How to find out who deleted the standard table enteries

    Hi,
    Somebody has deleted entire KNA1 in one of our systems. Is there any way to find out who deleted the entries?
    Thanks & Regards,
    Kumaran Duraiswamy.

    Hi
    Look for help from an ABAPer. Go to SE11 for KNA1, use 'where-used list (ctrlshiftF3) and search for report that begin with Z* or Y* (perhaps LZ* or LY*, ie: function modules). See the ABAP coding if there is any instructions type:
      DELETE kna1 FROM xxx.
    Check too if the option &SAP_EDIT in tcode SE16N works in your system (see SAP Note 1420281 - CO-OM tools: SE16N: Deactivating &SAP_EDIT for instance)
    I hope this helps you
    Regards
    Eduardo
    PD: I forgot it, if option &SAP_EDIT works in SE16N, check the tables SE16N_CD_DATA and SE16N_CD_KEY.
    Edited by: E_Hinojosa on Jun 24, 2011 11:04 AM

  • How to find out what is the name of table/view is being maintained in  IMG?

    Gurus,
    Any general trick to find out what is the name of table/view is being maintained
    by a given IMG item while configuring?
    Thanks,

    Hi,
    Click F1  on the table/ view you will get the table name and then go to transaction give this table name and click on Find Maintainance Dialog their you will get the views related to that table.
    Regards,
    IFF

  • Session Variable : How to find out where all it is used in the repository?

    Hello Everyone,
    We have a requirement where we need to convert a few session variables into repository variables. For this we need to figure out where all is that session variable used in the repository and webcat (which all logical columns use it, which all prompts use it etc). We tried the query repository utility but that didnt help. Is there any other way to find that out? Will really appreciate any pointers from your side.
    Thanks in Anticipation,
    Karan

    Hi,
    To find the variables used in,
    Rpd : Open the rpd->Navigate to Tools Menu->Select "Utilities"->"Repository Documentation".This will generate a csv file with the associations
    Webcat :Open the webcat using catalog Manager->Tools Menu->Create Report-.Select the desired columns (Include Xml column)->Open the rpeort in excel find "Variable"->from this you can find the various variables used in the catalog.
    Rgds,
    Dpka

  • How to find out who deleted the archive logs

    Hi All,
    Recently some archive logs were deleted from one of our servers. Is there any way to find out which user has deleted the archive logs through OS or through database ?
    OS Version :-
    SunOS Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise
    Database Version:-
    SQL*Plus: Release 9.2.0.8.0 - Production on Mon Apr 9 01:12:15 2012

    888132 wrote:
    Hi All,
    Recently some archive logs were deleted from one of our servers. Is there any way to find out which user has deleted the archive logs through OS or through database ?
    OS Version :-
    SunOS Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise
    Database Version:-
    SQL*Plus: Release 9.2.0.8.0 - Production on Mon Apr 9 01:12:15 2012As explained by others, from oracle database there is no record if they are deleted from OS.
    But you can probably find the history of OS command been run with history command :). You can get the date and time.
    Following link can help
    http://stackoverflow.com/questions/99755/how-do-i-get-the-command-buffer-in-solaris-10
    http://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/
    http://www.linuxquestions.org/questions/solaris-opensolaris-20/in-solaris-command-line-how-to-get-the-previous-commands-573814/
    But i suggest you to post in Sun OS forum to get more details as its nothing to do with Database(in this scenario)

  • How to find out what server the outlook client is connected to/change it automatically

    Hi,
    I am performing a server migration from Exchange 2010 to Exchange 2010 (the previous installation was installed by an outsourced provider and is rubbish so I'm configuring it properly). On the of things the existing server lacks is a CAS array configured,
    so I have built the new Exchange 2010 server, configured a new DB and CASArray. I have created a brand new mailbox for a new user and the user's outlook shows it is connected to casarray.domain.local, I have migrated my own mailbox but internally my outlook
    shows it is connected to oldserver.domain.local (under the account settings when you go to change the settings for the account), this is on a domain joined internal desktop. But at home on my personal laptop non-domain joined, it has appeared to reflect the
    new casarray.domain.local. The outlook client is 2007 in both situations.
    When I run the following command, it shows my mailbox is indeed connected to the new exchange server, but this is not true in outlook
    Get-LogonStatistics -Server "new-exch2010" | where {$_.clientname -eq "new-exch2010"}| ft username,servername,clientname
    If I run the above command against the old server my name shows on that list as well. When I look at the connection status of my outlook it shows that it is connected to casarray for directory, but the old server for mail.
    A couple of other things:
    Mailflow is now going to the new exchange server from the gateway over port 25, the autodiscover record in the internal DNS is now also pointing to the new exchange server, outlook clients and users computers have been completely restarted but still don’t
    seem to pick up the new settings, both the old server and new server functions as a multi-role exchange having the Hub, CAS and MBX roles.
     Now that you have all that background info my question is two parts:
    What is the correct powershell command I can run on the exchange server to ensure that all my outlook clients are connected to the new exchange server for all connection types (or identify those which are connected against the old server)?
    How do I get the outlook clients to automatically pick up the casarray servername once their mailboxes have been migrated?
    I am considering removing the CAS from the old server which may force outlook to find it’s new server but am unsure whether this will work or not, and I think I should migrate all the mailboxes into the new DB before I do this.
    Other than that, I am out of ideas.
    Appreciate, any help. Thanks
    Steve

    I had already run the command Get-MailboxDatabase | FL Identity,RpcClientAccessServer
    and it only identified the old database as being tied to the server name, the new database has the correct casarray and all mailboxes are in this new database. should I also set the old database to point to my casarray as the second command indicates? can't
    do any harm right?
    also, I have outlook 2007 and 2013 at home and both of them had automatically reconfigured
    themselves to point to casarray, my problem is with the internal clients.
    today I have also noticed in DNS there is a Zone which points to autodiscover.domain.co.uk
    and in there it points to my old server.
    a few things to note about the above:
    1. the zone is pointing to the .co.uk domain not the .local - is this correct?
    2. should that zone even be in our internal DNS, i hadn't noticed on previous implementation
    of Exchange I have done
    3. if i change the record within that zone to point to my new server, will this likely show
    up the popup message shown in this link http://www.rackspace.com/apps/support/portal/1218 I havent yet got a certificate for the new exchange server (few more days) and i dont want users seeing any kind of untrusted unsecure connection box or it
    will only lead to panic and flooding the helpdesk
    many thanks
    Steve

Maybe you are looking for

  • My iPod Won't Restore

    OK, so I plug in my iPod Touch to my computer (Windows Vista) and its in recovery mode at the moment and i have to restore it but every time i try it doesn't work, i comes up with an error and then goes back to recovery mode. Any help? Ed

  • HP Officejet 7100 all-in-one series (7140xi) Leopard support

    Ha anyone found specific software for the Office Jet 7100 series, specifically the 7140xi. The 10.4 drivers kind of work for scanning, but are not universal and will not work in other applications. The print drivers are only partially working, but th

  • "Access to this album or movie is restricted"

    When I attempt to view a page within one of my published web gallery albums, I rarely get past the first page without getting the message "Access to this album or movie is restricted. Please contact the site host for a username and password." This me

  • Lost 5750 All In One Disk.. Update Made Unit Inoperable

    Hello. I have an old 5750 all in one. I run Vista home on my laptop that interfaces with the unit. Whenver hp wants to update the "Solution Center" software already loaded on my laptop, it requires the original CD. I dont have it anymore. I tried to

  • Need a bit of help with css and fullscreen

    I am currently doing a javaFX application for my university project, I have it everything nearly finished, but need to finish the css component to make the application "prettier" (I am not very good on graphic design to be honest). So if i could get