Equivalent of inputting an Integer but a character instead?

Hi,
If I wanted to input a number/integer i could use the following:
Scanner s = new Scanner(System.in);
int time= s.nextInt();
How would I do the same if I wanted to input a character?
If I wanted to input a string what do i change?
many thanks for your help..
Yash

Doesn't that convert the integer into character or something using the ASCII tables?
I probably misunderstood what you're trying to say. Basically I want to enter the character 'B' and assign it to a varialbe at the command prompt and then afterwards I want to enter the String 'Hello' at the prompt and have it assigned to a variable. How would I do that?
System.out.println("please enter character");
System.out.println("please enter String");
I'm reading through the Java book by Walter Savith and the guy uses his own way of reading them in (Savitch.readLine() ), but I want to use the real Java method, which is why i'm stuck;)
thanks again..
Yash

Similar Messages

  • In my application I am using input type = "time" but in Firefox 30.0 its showing plain text box. Can anyone tell me which version of Firefox supports it.

    In my application I am using <input type = "time"> but in Firefox 30.0 its showing plain text box. Can anyone tell me which version of Firefox supports this feature?
    <input type = "time"> is added in HTML5.

    See:
    *https://developer.mozilla.org/Web/HTML/Element/Input#Browser_compatibility
    <i>Please do not comment in bug reports<br>https://bugzilla.mozilla.org/page.cgi?id=etiquette.html</i>

  • How to create custom search box will allow up to 60 alphanumericcharacters & User can input a minimum of 1 character and the system will pull back an exact match on the sequence entered.

    Hi,
    Can anyone please help me in creating the Custom Search box with below mentioned functionality
    "The search box will allow up to 60 alphanumeric characters.User can input a minimum of 1 character and the system will pull back an exact match on the sequence entered"

    Hi Pradeep,
    Find the complete JQuery AutoComplete function with along with different events in it like focus, select, open and close. You can modify this code as per your requirement.
    $("#ddlSearchTextBox").autocomplete({
    source: function (request, response) {
    var getUrl = "<site URL>";
    $.ajax({
    url: getUrl,
    type: "GET",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    data: {
    featureClass: "P",
    style: "full",
    maxRows: 10
    dataFilter: function (data, type) {
    return data.replace(/\\'/g, "'");
    success: function (data) {
    response($.map(data.d, function (result) {
    return {
    label: result.Last_Name + ", " + result.First_Name,
    value: result.id
    focus: function (event, ui) {
    $("#ddlSearchTextBox").val(ui.item.label);
    return false;
    minLength: 1,
    select: function (event, ui) {
    $("#ddlSearchTextBox").val(ui.item.label);
    return false;
    open: function () {
    $("#ddlSearchTextBox").removeClass("ui-corner-all").addClass("ui-corner-top");
    close: function () {
    $("#ddlSearchTextBox").removeClass("ui-corner-top").addClass("ui-corner-all");
    Let us know if you need any further.
    Thanks, Shakir | Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Checking input as Integer

    HI,
    can any body tell me that how can i check that an input form a jsp(page1) is number or not ?
    page1.jsp
    <form method = "POST" action = "page2.jsp">
    input type = "text" name = "number"
    input type = "submi"t value = "submit"
    </form>
    page2.jsp
    Now here i want to check that the input is integer or not
    How can i do that
    thanks

    Well you have it as a string right?
    String enteredValue = request.getParameter("number");
    // Is the value there?
    if (enteredValue == null){
      // no value entered.  error?
    else {
      // check if it is an actual number
      Integer enteredNumber = null;
      try{
        enteredNumber = Integer.valueOf(enteredValue);
      catch(NumberFormatException e){
        // not a valid integer
    }

  • INPUT THE END-OF-FILE CHARACTER/ CRTL-C in Jdeveloper

    I'm trynta input the end-of-file character in the program input window (JDeveloper) so i can exit the while loop below. The window accepts all other characters except the CTRL-C character sequence in windows. How does the user exit this loop?
    while (input.hasNext()) { //loop until EOF character
    try {
    //retrieve data to be input
    record.setAccount(input.nextInt());
    record.setFirstName(input.next());
    record.setLastName(input.next());
    record.setBalance(input.nextDouble());
    if (record.getAccount() > 0) {
    output.format("%d %s %s %.2f\n", record.getAccount(),
    record.getFirstName(), record.getLastName(),
    record.getBalance());
    } else {
    System.out.println("Account number must be greater than 0");
    } //end try
    catch (FormatterClosedException e) {
    System.err.println("Error writing to file.");
    return;
    } catch (NoSuchElementException e) {
    System.err.println("Invlaid input. Please try again.");
    input.nextLine();
    System.out.printf("%s %s\n%s", "Enter account number (>0), ",
    "first name, last name, and balance.", "? ");
    } //end while
    //...

    Hi,
    U need to use one class. Refer below given code.
    TYPES : BEGIN OF lt_record_input,
              rec(1000) TYPE c,
            END OF lt_record_input.
    DATA : li_record_input TYPE TABLE OF lt_record_input .
    DATA lv_cr TYPE c.
    lv_cr = cl_abap_char_utilities=>cr_lf.
    CONCATENATE '/opt/isv/cti_app/DOCU/INCOMING/PROCESSED/UNSUCCESSFUL/'
    gv_filename INTO lv_path.
    OPEN DATASET lv_path FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc = 0.
      DO.
        READ DATASET lv_path INTO lw_record_input-rec.
        IF sy-subrc EQ 0.
          REPLACE lv_cr IN lw_record_input-rec WITH space.
          APPEND lw_record_input TO li_record_input.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET lv_path.
    ENDIF.
    Hope it help u.

  • Build the equivalent of a "Microsoft service" but in Java.

    Hi,
    I need to find the best design ( architecture ) to build the equivalent of a Microsoft Service but in Java.
    I do have a database table that need to be scan by a "Service" and if the "service" find any message in this table an email need to be send.
    I already have the aside stuff ready to go ( javamail, database, etc. )
    Now I need the design to build something which will do :
    - automatically starts when computer turn on.
    - run in "background" as a service and scan every X given secondes the database to find out new email to send.
    I don't think web services are the right design for me, but if I'm wrong just tell me.
    Every suggestion are welcome! ( Any technology )
    thank you!

    you might look into how these guys are doing it
    http://wrapper.tanukisoftware.org/doc/english/introduction.html
    http://www.alexandriasc.com/software/JavaService/documentation.html
    http://www.eworksmart.com/JNT/QuickDocumentation.htm
    and check out the notes here
    http://www.swtech.com/java/ntsvc/
    Good luck
    Lee

  • When i open an irc link with a channel name that contains "~" at the end, firefox (14.0.1) opens the same channel name but with "%7E" instead of "~" at the end

    when i open an irc link with a channel name that contains "~" at the end firefox (14.0.1) opens the same channel name but with "%7E" instead of "~" at the end
    http://img835.imageshack.us/img835/2856/clipboard05nq.jpg

    I can not open the image, but I can say something in general about the tilde.<br>
    The tilde "~" is an unreserved character and therefore it can be replaced by its percent-encoded form "%7E" inside a URI without changing meaning. See<br>
    http://en.wikipedia.org/wiki/Percent-encoding<br>
    According to section 2.3 of RFC3986 we should prefer the unencoded form so this behavior seems to be a bit out-dated.<br>

  • Meaning of: feature was simple feature call but got receiver instead of null

    I implemented my own XbaseInterpreter. I forked the context in my subclass and added some new values. Lets say one of the values has type X.
    When I call the evaluate method with my XBlockExpression and the forked context I get the exception
    "feature was simple feature call but got receiver instead of null. Receiver: <here the instance of X>
    What am I doing wrong?
    What does the exception message mean?

    Hi Sebastian,
    I understand the first part of your answer. In my case the Xbase interpreter tries to assign an object to a variable where the interpreter thinks the left side of the equation is void which leads to the given message "feature was simple feature..."
    But I do not understand how this can happen in my case.
    I have an XBlockExpression with this content:
    val x = 1
    return x == 1
    The error occurs for the variable declaration when the interpreter tries to assign the integer to the left side.
    What am I missing?
    Do I have to initialize the evaluation context?
    The strange thing is that if I start the interpreter by initializing it with the standalone setup within Eclipse (which is not recommended) I do not get the above mention exception at all ( I do get class cast exceptions because of including the standalone setup but the expression is interpreted correctly).
    What is the difference between the standalone setup and the "normal" Eclipse runimte for interpreting expressions?
    With regards,
    Udo

  • How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC?

    How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC? When I create rectangle I can't transform it by dragging and it's only the problem with rectangle, not with circle, star etc. I try show/hide edges/bounding box reset preferences and reinstall whole illustrator CC and it's the same. I can only make this right by expand this rectangle, which is shape as is turn out to rectangle by clicking object>shape>expand rectangle. But this is so frustrating. Help!:) oh, and I use OSX. My friend has the same specs and it's works. I mean she can use live shape corner transformations and changing size by draging:(

    I’ve created my own plugin (available for free for personal and commercial use) which imitates behavior of the ‘old’ Rectangle Tool. It doesn’t replace the Live Rectangle – it works completely independent!
    My Plain Rectangle Tool correctly snaps to grids/objects/points and correctly aligns to grid/points on resize. Of course it supports the SHIFT and ALT/OPTION keys, Snap to Grid and Smart Guides options. In other words it works almost 100% the same as the Rectangle Tool we know from CC (17.1), CS6 and earlier.
    The installation package (zxp) adds ‘Plain Rectangle Tool’ icon into the Ai panel (of curse you can assign your custom keyboard shortcut to it as well)
    Note: The Plain Rectangle can be easily converted into the Live one using Object > Shape > Convert to Rectangle
    Grab your copy at http://63mutants.com/subc/products/PlainRectangleTool_m01/PlainRectangleTool_m01.php Feel free to share with your friends. It’s completely free.
    I’ve also created a separate discussion https://forums.adobe.com/thread/1587587 for the Plain Rectangle Tool. If you have any comments or request please post it there. Any feedback would be greatly appreciated!
    Thanks,
    Pawel Kuc

  • I was trying to sync my latest photos from iphone onto iphoto but pressed restore instead of sync. Now it's deleted my latest photos taken a week ago. Is there a way to get back those photos via backup somehow?

    I was trying to sync my latest photos from iphone onto iphoto but pressed "restore" instead of "sync". Now it's erased my latest photos taken on my iphone a week ago and erased music saved in itunes library. Is there a way to find these photos and music via backup?

    Thanks so much Meg. Unfortunately, iTunes is the program I use to perform syncing. I don't really have other outside options. It is also the location of the backup I would use to restore my phone, and my only way to reclaim important data. I am concerned that, since the last backup occurred when the "other" bar was only moderately huge (around 29G I think), that a backup would replicate the problem back onto my phone. 
    My contacts, etc. are all in address book and the calendar app on my Mac.  As far as I know, iTunes is the way to get them back, but iTunes is where the problem is. 
    Any thoughts on this?

  • I'm using iweb 3.4 and trying to load audio files to my web page.  everything looks good in iweb but after publishing instead of having a control bar i have a "?".  does anyone know what to do?

    I'm using iweb 3.4 and trying to load audio files to my web page.  Everything looks good in iweb but after publishing instead of having a control bar i have a "?".  Does anyone know what to do?

    Where are you hosting the site, how are you uploading the files and what's the URL of your site so we can examine it first hand?
    Adding audio files by dragging onto the web page forces the viewer to have Quicktime installed on their computer in order to be able to listen to them.  Look at the audio player options on this page of Roddy's iWeb for Musicians site: Audio Players for your Music Website. 
    OT

  • G4 MDD 1.25 does not sleep but turns off instead.

    I have a G4 1.25 MDD single running 10.3.9 with 80GB and 20GB HD, 1.5GB RAM which is mated to a 20" Apple cinema monitor.
    Both hard drives have been erased and verified using the disk utility from the software install CD and the OSX installed cleanly. I have run the Apple hardware test and all the results are okay.
    However, if i try to sleep the computer from the pulldown menu, the computer performs the motions as if it's going to sleep but turns off instead. If i try to sleep it with the power button on the monitor nothing happens. Other than this, the computer is in perfect working order.
    Does anyone know what the problem can be??
    Many thanks
    T

    Hi-
    Steps to take are replacing the PRAM battery with a new one, followed by a PMU reset:
    Resetting Cuda/PMU on Power Mac G5, Power Mac G4, Power Macintosh G3

  • Convert integers to equivalent characters in string - NOT ASCII code character

    I have to output my data and associated string information to a string array and then to a spreadsheet file.
    I want to do this by converting integers (and other numbers) to an identical string of characters.
    I have tried Type Cast with a string constant as the type input but it DOES NOT WORK.  Instead, I get the ASCII character whose numerical designation matches the integer, e.g. integer "50" become capital "P".
    I want integer "50" to be string "50".
    Please advise and no, I do not want to make arrays of clusters.
    Solved!
    Go to Solution.

    I found my answer but only after searching for "Number" conversion rather than "Integer" conversions.
    In the Programming palette  - String Functions - String/Number Conversion - Number to Decimal String:
    "Converts number to a string of decimal digits at least width characters wide or wider if necessary. If number is floating-point, it is rounded to a 64-bit integer before conversion."

  • Firefox didn't show any response to AUTOCOMPLETE="off", I implment this code in form tag and even in input tag too, but no response

    Firefox didn't show any response to AUTOCOMPLETE="off", I try so many codes using jquery and html but no response, I implement this code in form tag as well as in input tag, in my registration form when ever the cursor focus on the username field already saved username display, pls let me help me to solved this issue.
    Thanks.
    Saravanaraj
    [email protected]

    If autocomplete data already previously has been saved in Firefox then adding autocomplete=off won't have effect since this data is already stored and you need to remove this manually via (Shift+) Delete.
    If you are experimenting with code then you need to take this into account and possibly use forget about this site.
    Using "Forget About This Site" will remove all data stored in Firefox from that domain like bookmarks, cookies, passwords, cache, history, and exceptions, so be cautious and if you have a password or other data from that domain that you do not want to lose then make sure to backup this data or make a note.

  • ADF input label rendered but input value not

    I based my search page on SRDemo template. In the first panel where I enter search criteria I have the following:
    <af:panelBox>
    <af:panelForm>
    <af:inputText value="#{bindings.partialName.inputValue}"
    label="#{bindings.partialName.label}"
    required="#{bindings.partialName.mandatory}"
    columns="#{bindings.partialName.displayWidth}">
    <af:validator binding="#{bindings.partialName.validator}"/>
    </af:inputText>
    <f:facet name="footer">
    <af:panelButtonBar>
    <af:commandButton actionListener="#{bindings.queryProfiles.execute}"
    text="#{res['oysearch.searchLabel']}">
    <af:setActionListener from="#{false}"
    to="#{userState.oySearchFirstTime}"/>
    </af:commandButton>
    </af:panelButtonBar>
    </f:facet>
    </af:panelForm>
    <af:panelTip>
    <af:outputText value="#{res['oysearch.searchtip']}"/>
    </af:panelTip>
    </af:panelBox>
    but when I run the page I only get the input label shown and the Search button, but no Input Value (which is shown in the design view of the page)!?
    I checked the attributes and compared with SRDemo and it shows Rendered, mandatory etc.
    I have following in my page def file:
    <methodIterator id="queryProfilesIter"
    Binds="queryProfiles.result"
    DataControl="SearchProfileFacadeLocal"
    RangeSize="10"
    BeanClass="valueobjects.ProfileVO"
    RefreshCondition="${!userState.oySearchFirstTime}"/>
    <variableIterator id="variables">
    <variable Type="java.lang.String"
    Name="queryProfiles_partialName"
    IsQueriable="false"/>
    </variableIterator>
    <methodAction id="queryProfiles"
    MethodName="queryProfiles"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"
    DataControl="SearchProfileFacadeLocal"
    InstanceName="SearchProfileFacadeLocal.dataProvider"
    ReturnName="SearchProfileFacadeLocal.methodResults.SearchProfileFacadeLocal_dataProvider_queryProfiles_result">
    <NamedData NDName="partialName" NDType="java.lang.String"
    NDValue="${bindings.queryProfiles_partialName}"/>
    </methodAction>
    <attributeValues id="partialName" IterBinding="variables">
    <AttrNames>
    <Item Value="queryProfiles_partialName"/>
    </AttrNames>
    </attributeValues>
    Why is the input value not shown on this ADF panel?
    thanks

    Hi,
    authorizing the page does not authorize all contained objects for better granularity in uthorization.
    Frank

Maybe you are looking for

  • How to change the standard query "Create a Master Agreement" by a custom one

    Hello Sourcing CLM experts, I would need to replace the standard query displayed when the user tries to create a Master Agreement by a custom query to filter the MA types according to some criteria: According to this post: Re: Create security profile

  • I am getting and error message saying a duplicate file name was specified

    Help I am trying to sync new songs onto my Iphone and keep getting an error message telling me "the iphone can not be synched. a duplicate file name was specified" how can i fix this,

  • Outbound file

    Hi ,   i need to send the SAP data to liberty through an outbound interface flat file . The file has 3000 characters and in that they are only few fields from SAP has to be filled and the rest of the fields  has to be filled with spaces in between th

  • Organizing iPhoto / Kodak Easyshare

    Hi! I have many zillion photos. I use iPhoto, and Kodak Easy Share, hence some are duplicates. I'd like to get control of the situation, and store them in one place. What do you all do? AND where the heck are the photos from iPhoto? I do find folders

  • Installing Adobe Creative Suite to Shared Applications folder

    Hello, I have a client asking to install Creative Suite to a shared application folder on the server. Can you anyone with some experience on this provide any feedback on performance, issues, stability etc? Is it even doable with Creative Suite to hos