How can I read an input which only contain the 26 upper case letter

Are there any method that can read an input which only contain 1 character and it is in upper case too.
should I use readChar( ), or readString( )??
How should I implement them if I do use one of them?
thx

Try this :
import java.io.*;
public class Read
public static void main(String[] x)
System.out.println("Upper case char typed : "+readUpperCaseChar());
public static char readUpperCaseChar()
// method that read char and return the last upper case char
char x='\0',tmp='\0';
try
while(tmp!='\n')
tmp=(char) System.in.read();
if(tmp >= 'A' && tmp <= 'Z')
x=tmp;
catch(IOException ioex)
ioex.printStackTrace();
return x;

Similar Messages

  • HT201184 how can i get my google window back in the upper right hand corner. It disappeared.

    how can I get my google window back in the upper right hand corner of my start page?  I seem to have lost it.

    Control click in the tool bar area and customize.

  • How can i read user input value to my User exist

    Hi Guru's,
    I am facing one problem in Variables in BPS.
    I am calculating days from Month/year .I have one variable it is for Days,Second variable it is for Month/Year.
    First variable is user exist (for calculating the days),Second varible is user defined variable(this is a Input to the first variable).
    When i am giving the Month/Year(02/2008)variable i am getting the 29 days from the first variable.again i am changing the value of Month/Yera(03/2008) i am not getting the desired value.
    my doubt is my user exist not able to read current value of variable(month/year).how can i pass my value to user exist because this value is user input value based on this value i am calculating the days and dynamically displaying the layout.
    Here is the my sample code..
    seq = '0000'.
    ind = 0.
       i_area = 'ZTEST1'.
       area_var = 'ZVar2'.
    PERFORM instantiate_object USING    i_area
                                        area_var
                                 CHANGING lsr_var.
    PERFORM get_current_value_of_variable
                            USING lsr_var
                            CHANGING lto_value.
    READ TABLE lto_value INTO lso_value index 1  .
    i_month = lso_value-low.
    iv_month = i_month+4(2).
    iv_year = i_month(4).
    concatenate iv_year iv_month '01' into iv_date.
    begindate = iv_date.
    below bracket code calculating the leap year
    ( IF iv_date+4(2) = lc_feb.
        lv_hlp_date_year = iv_date+0(4).
        lv_hlp_rest      = lv_hlp_date_year MOD 4.
        IF lv_hlp_rest = 0.
          EV_DAYS = lc_days_29.
          lv_hlp_rest = lv_hlp_date_year MOD 100.
          IF lv_hlp_rest = 0.
            lv_hlp_rest = lv_hlp_date_year MOD 400.
            IF lv_hlp_rest NE 0.
              EV_DAYS = lc_days_28.
            ENDIF.
          ENDIF.
        ELSE.
          EV_DAYS = lc_days_28.
        ENDIF.)
      ELSE.
    below bracket code calculating the days
    (   CASE iv_date+4(2).
          WHEN lc_jan. EV_DAYS = lc_days_31.
          WHEN lc_mar. EV_DAYS = lc_days_31.
          WHEN lc_may. EV_DAYS = lc_days_31.
          WHEN lc_jul. EV_DAYS = lc_days_31.
          WHEN lc_aug. EV_DAYS = lc_days_31.
          WHEN lc_oct. EV_DAYS = lc_days_31.
          WHEN lc_dec. EV_DAYS = lc_days_31.
          WHEN lc_apr. EV_DAYS = lc_days_30.
          WHEN lc_jun. EV_DAYS = lc_days_30.
          WHEN lc_sep. EV_DAYS = lc_days_30.
          WHEN lc_nov. EV_DAYS = lc_days_30.
          WHEN OTHERS.   CLEAR EV_DAYS.
        ENDCASE.)
      ENDIF.
    data: st_date(2) type c.
    st_date = '01'.
    ind = 0.
    ind = ind + 1.
    here i am passing the low value and high value.
    yto_charsel-chanm = '0CALDAY'.
    yto_charsel-seqno = 1.
    yto_charsel-sign  = 'I'.
    yto_charsel-opt   = 'EQ'.
    yto_charsel-LOW = st_date.
    yto_charsel-chanm = '0CALDAY'.
    yto_charsel-seqno = 1.
    yto_charsel-sign  = 'I'.
    yto_charsel-opt   = 'BT'.
    yto_charsel-high = ev_days.
    INSERT yto_charsel INTO sto_charsel INDEX ind.
    ETO_CHARSEL = sto_charsel.
    lto_value = sto_charsel.
    How can i pass user input value to read this exist ,some where again i have to write code or else??
    This is very urgent can you help me..

    Hi,
    Instead of two perform statements, use single perform.
    PERFORM get_value USING i_area
                              i_variable
                         CHANGING lw_varsel.
    Take the values from lw_varsel-low.
    FORM statement for this perform is as follows.
    DATA: li_varsel TYPE STANDARD TABLE OF upc_ys_api_varsel,
            lv_varsel TYPE REF TO cl_sem_variable.
      FORM get_value USING p_area TYPE upc_y_area
                           p_variable TYPE upc_y_variable
                     CHANGING
                           p_lw_varsel TYPE upc_ys_api_varsel.
        CALL METHOD cl_sem_variable=>get_instance
          EXPORTING
            i_area       = p_area
            i_variable   = p_variable
             I_CREATE     =
          RECEIVING
            rr_variable  = lv_varsel.
           EXCEPTIONS
             NOT_EXISTING = 1
             others       = 2
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        REFRESH li_varsel.
    ****Getting the Value*********
        CALL METHOD lv_varsel->get_value
          EXPORTING
            i_user     = sy-uname
            i_restrict = 'X'
          RECEIVING
            rto_value  = li_varsel.
        CLEAR : p_lw_varsel.
        READ TABLE li_varsel INTO p_lw_varsel INDEX 1.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
      ENDFORM.                    "get_value
    Try this code.
    Bindu

  • How can I separate 2 ipads which are on the same account?

    I have an ipad and my husband also recently bought one.  Unfortunately my son set my husband's ipad up on the same account as mine so we now have exactly the same music and photos on both plus my Gmail account is sending the messages to both.  How can I separate these now but still carry on using the same laptop?

    You will have to transfer the ringtones from the phone that has them to your iTunes library.
    File>Transfer Purchases.
    Then you can sync them to the other phone.

  • How can I telll my application to only empty the trash and go to sleep if there is trash in the trash  ?

    So basically I made an application called TrashEmptier with apple script and what it does is it asks you if you want to empty the trash so you press ok and it empties the trash and then lets the computer go to sleep but it does it even if there isn't anything in the trash but how can i make it so if that they're isn't anything in the trash then it wont try to empty it and go to sleep by the way this app was made with apple script editor.
    adam

    This is a perfect example of why background apps aren't allowed: Imaging your user forgot that they'd set this running in your application, and then discovered that their battery was running flat in no time, because your application is constantly opening network connections.
    Sorry to say that your application design is flawed if you were expecting to be able to run in the background. It's all spelt out clear as day in the iPhone OS programming guide though, so you can't say you weren't warned.

  • How can I read an input, for example: "Enter number of years: "?

    I am not really "new" to Java, but for a long time I have been using a book that comes with TerminalIO.KeyboardReader and I need to get input without using that class.
    I just need the class required really, but the actual instantiation and the line with the question would be great as well.

    One solution is to use java.util.Scanner: [http://java.sun.com/docs/books/tutorial/essential/io/scanning.html]

  • How can i read comments from properties file in the right order??

    Hello
    I want to build a console that read a properties file and print to the screen the property name, property value and property description and the developer can change the name or the value or the description of the property and update the property file.
    But the problem in using the properties class that it doesn�t read the comment and not save the properties in their order so I can�t couple description and name of the property.
    Does any one know any utility that do the job or know how to solve the reading the comments problem???
    Thank you a lot?

    sorry but i dont understand how the solution of using
    a dot ( property_key.description ) helping me to
    solve the problem?
    please try to explain it agin.
    thank youYou wrote:
    "I want to build a console that read a properties file and print to the screen the property name, property value and property description and the developer can change the name or the value or the description of the property and update the property file."
    So i'm as developer imagine that somebody edit properties in GUI or console. So you have 3 text fields: property name, property value, and propety description. Then developer save edit changes, then text fields maped to properties file and:
    text field "property name" and text field "property value" construct property:
    name=valuetext field "property name" adding ".description" and text field "property description" construct property:
    name.description=descriptionFor one described property, you will have put two properties.
    Thanks!

  • How can a jsp page tell which Oracle Responsibility the user has selected?

    We have two responsibilities - Timecard Administrator and Timecard Viewer. Everything that they can access is the same, except for one particular jsp page which we want to present a slightly different view if the user's responsibility is Timecard Viewer (specifically, the edit link in the results page will be suppressed). Unfortunately in order to implement this, the jsp code needs to be able to distinguish which of those two responsibilities the user has selected. I have written jsp code to print all the environment variables and unfortunately the environment is essentially identical regardless of which of the two responsibilities the user selected.
    How do I pass in the active responsibility to that page/environment in a way that can be tested by the jsp code?
    Thank you,
    Graham Toal <[email protected]>

    Yes, I tried something like this (shortened to the basics for this post):
    <pre>
    sqlQuery="select responsibility_name from fnd_responsibility_vl where responsibility_id = FND_GLOBAL.RESP_ID";
    stmt=con.createStatement();
    rs=stmt.executeQuery(sqlQuery);
    int field_count=rs.getMetaData().getColumnCount();
    while (rs.next()) {
    for (int i=0; i<field_count; i++) {
    logger.write("Responsibility: "+rs.getObject(i+1),"JSP",objName,0,-1,1001);
    </pre>
    However it did not print any results at all.
    I'm trying a different approach at the moment - I've cloned the menus from the Administrator responsibility to the new Viewer responsibility, and have altered the top-level menu so that I can insert a new variable into the process state myself; that way by the time the user navigates to the changed page, there should be a variable there that can be tested.
    Unfortunately the top-level menu isn't just a simple menu, it's a piece of code that issues an HTML redirect depending on the parameter passed in - which is set in the Oracle function screen for the function attached to that menu.
    (was something like utpa_top_menu.jsp?ADMIN and I changed it to utpa_top_menu.jsp?VIEWER, with appropriate tests for the new module name:
    <tt>
    else if ("VIEWER".equals(moduleName))
    url = "/utpa/jsp/admin_reports-viewer.jsp";
    </tt>
    In admin_reports-viewer.jsp I've added <tt>session.putValue("REPVIEWER","y");</tt> and in the actual target main page I have:
    <pre>
    if (session.getValue("REPVIEWER") == "y") {
    // viewer
    out.println("<CENTER><B>You are using the Timecard Viewer responsibility</B></CENTER><BR>");
    } else {
    </pre>
    And although the URL bar at the top of the screen is displaying the correct (redirected) URL, the page that is displayed is blank. Completely empty. 0 bytes. The file is present on the filing system; has content; has the correct ownership and permissions; I've reloaded apache, even had the systems guys reboot completely. I'm at a loss :-/
    Graham

  • Two things came with my Firefox when I downloaded it. Speed Dial and Xmarks. When I start the program it locks up and I have to just shut it down. How can I delete them? I only want the Firefox.

    When I downloaded Firefox I had two things download with it. Speed Dial and Xmarks. I don't know about either and don't want them. I cannot delete them alone it seems. When it all loads it locks my computer up totally. I cannot x out of anything. Just kind of "thunks" with a dead sound. My facebook applications runs better on Firefox but I can't seem to get it downloaded alone. What am I doing wrong? I do not want the speed dial for sure. Don't know about the Xmarks.

    Where did you download Firefox from?
    The official Firefox download doesn't come with either of those addons.
    http://www.mozilla.com/en-US/firefox/
    or
    http://www.mozilla.com/en-US/firefox/all.html

  • How can i read more then one channel with the amux64

    Im using AI one scan.
    I tryed the string AM1 ! 0,1 and also AM1 !0:1 but it didnt worked.

    Barak,
    Check the following link, it must solve your issue:
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/ef832cdaf87e9bf8862568a5007b2f47?O​penDocument
    Hope this information is helpful
    L Aguila
    Applications Engineer
    National Instruments

  • How can I remove files that do not contain the number 1 or ~1?

    I had to convert many .avi files.  The new names all contain ~1.  Those files I want to keep and remove the originals.  There are scripts to remove files with a numeral such as 1.  I need one to remove all files without the 1 or ~1. 
    I tried using a script that removed older files, but the new files seemed to have the same created dates and modified dates so that will just delete all the files.

    Thanks for your input.  I want to keep the files with a 1 or ~1 as it happens and delete the rest.  I have written some scripts.  I think I could write a script to delete all files with a 1, but of course that is not what I want.  I guess
    I need a script to delete all files except if they contain a 1.  I haven't used a forum since way back in the PC mag days.
    Whoops..........I just realized exactly what you were telling me and used your suggestion.  I guess I was trying to do more work than I needed.  I searched for all files with a 1 in the folder and then moved them to a different folder.  Then
    I deleted the rest.  Job done.  Thanks for the help.

  • How can I reading environment variables (user variables)

    Hi,
    I hope someone can halp me out:
    In the software that I develop it is neccessary to read some user (environment) variables, such as the temp folder of the current user.
    I know that I can read out some system variables like this:
    String homePath = System.getProperty("user.home");
    But how can I read out some other variables, especially the temp folder of the current user?
    Thanks

    I might have misunderstood you, but I am notlooking
    for the PATH variable. I need the location of
    the
    temp folder of the current user. This should be
    called TEMP or so, but this does not work.Can you deduce from the link he provided, to lookat
    System.getenv(), and find the "TEMP" environment
    variable in what it returns to you?That said, I believe the "temp" folder may be
    provided in one of the normal System properties
    anyway, so you probably don't need to go that route.
    Print all your System.getProperties() values, and see
    if it's in there.Yepp. os.io.temp or something.

  • HT4059 how can i read books when not connected to wifi , at the moment have to g through apps store , which requires a connection . I want the books on the i pad not in  a acloud

    How can i read books purchased from i books when not connected to wifi . At the moment can only access via app store , which can only do when connected . I want top download to the device , not keep in a cloud!

    If you download them via the Purchased tab in the ibookstore in the iBooks app on your iPad then they should show in the Books collection on the app's bookshelf - and you should be able to read any books that you download from the store to your bookshelf without needing to be online.

  • How can I read Extended APDU input to the same buffer

    The following is the code I am currently using where inBuffer is an intermediate array of 1000 length. However, I do not want to allocate any buffers at all, and just want to send a command apdu of 1000 byte length and modify it in the code and return the modified buf in the response APDU.
    // Read extended APDU input
    byte[] buf = apdu.getBuffer();
    short bytesRead = apdu.setIncomingAndReceive();
    short dataOffset = apdu.getOffsetCdata();
    // store first chunk in our intermediate byte array <-- how do i get rid of the intermediate array
    Util.arrayCopyNonAtomic(buf, dataOffset, inBuffer, (short) 0, bytesRead);
    // what is the overall length?
    short overallLength = apdu.getIncomingLength();
    short messageOffset = bytesRead;
    if (bytesRead != overallLength){ // otherwise we're finished, all bytes received
         short received = 0;
         do{
                   received = apdu.receiveBytes((short)0);
                   Util.arrayCopyNonAtomic(buf, (short)0, inBuffer, messageOffset, received);
                   messageOffset  += received;
              } while(received != 0);
    * REST OF CODE IN PROCESS METHOD
    I have also tried replacing the above code with the following
    short bytesLeft = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);
    if (bytesLeft < (short)55) ISOException.throwIt( ISO7816.SW_WRONG_LENGTH );
    short readCount = apdu.setIncomingAndReceive();
    while ( bytesLeft > 0){
      // process bytes in buffer[5] to buffer[readCount+4];
      bytesLeft -= readCount;
      readCount = apdu.receiveBytes ( ISO7816.OFFSET_CDATA );
    as shown in the javadocs API, but it does not compile.
    This is my command APDU:
    /send 800100000003E8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003E8
    As you can see:
    CLA - 80
    INS - 01
    P1 & P2 - 00
    LC - 0003E8
    Data - 1000 0s
    LE - 03E8
    I am using JavaCard 3.0 with JCOP in Eclipse. How can I read the extended length apdu to the same buffer? I have no problem in returning an extended length response APDU. Thanks a lot for the help.

    You should not call the convenience method setIncomingAndReceive() in your first code. Please find out about the different APDU states. Furthermore, your Applet should implement the ExtendedLength tagging interface.

  • How can I read text files from LAN if I only know the hostname?

    I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
    <p>1. How can I read text files from LAN if I only know the hostname, or IP address?
    <p>2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.
    (ex. how can I read the 120th line?)
    <p>Please help!
    <p>sorry for the bad english

    I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
    1. How can I read text files from LAN if I only know the hostname, or IP address?You need to know the URL of the file. You need to know the hostname, port, protocl and relative path.
    The hostname is server, not file.
    2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.Use the seek() to get to a random byte.
    (ex. how can I read the 120th line?)The only way to find the 120th line is to read the first 120 lines. You can use other file formats to find the 120th line without reading the whole file but to need to be able to detremine where the 120th line is

Maybe you are looking for

  • Ni 9401

    Ok, I have (4) rotary encoders (1600pulses/reve) each.  I also have (2) Ni 9401's mounted in slots 5 and 6 of my C-Daq chassis.  I followed the quadrature encoder measurements: How to guide with no positive results.  I've set up a variety of tasks in

  • Asynchronous Communication - R/3 - XI

    I'd like to get your opinion on the best method of Asynchronous communication between R/3 and XI given the following assumptions: •     ABAP Proxies are not an option. SAP R/3 is version 4.6C with Basis 4.6D •     Standard IDocs are only available fo

  • Make-To-Order MRP for components with unstricted-use stock

    Dear Experts, There is a finished goods of material with standard planning strategy group "20" in the material master. There is a component e.g. material A, under the BOM of the FG material. There is already enough unrestricted stock for material A w

  • Desktop CHM pages won't display

    Hi, I am trying to run a chm from RoboWizard and other chm files from my destop and the pages won't display. I created a new test chm and the pages displayed ok. Thanks D

  • What is using my memory?

    hi I have a Mac Mini with 8 gb of Ram running Yosemite, and I have the app Memory Clean running on my task bar, which I use to periodically free up memory. However, most times it shows that I have between 2 and 3 gb of Ram free, and I'm not sure why