How to use simple input command ??

I am tired of trying to find an easy to understand source to implement simple INPUT command ( equivalent to cin>> and scanf() , in c++ and c as i m good in those two)
when print can be System.out.println(--) , then y does read have to be so complicated ?
Help me out guys !!!

package palindrome;
import java.io.DataInputStream;
* @author Pulkit
class Main {
public static void main(String[] args) {
int num;
System.out.println("Enter a number to check if it is palindrome");
// System.in.readline(num);
DataInputStream ob = new DataInputStream(System.in);
Now the remark line is wat i tried to do, as i thought it should follow the print method ( System.out.print ) that one.
But in a book , i see its done just the other way, just below the rem line.
I just need ur help to explain me as to how that line has been put, i.e. the syntax of that line.

Similar Messages

  • How to use ls-l command in SAP ??

    Hi,
    can any one suggest how to use ls-l command of unix in sap to get the details of file like creation date,etc.
    Thanks.

    Hi Krishna.
    These are the steps you need to follow.
    tables: specify the table.
    data: begin of fs_...
            end of fs_    " Structure Field string.
    data: t_table like
            standard table
                      of fs_...
    data:
    w_file TYPE string.
    data:
      fname(10) VALUE '.\xyz.TXT'.
    select-options: if any.
    PARAMETERS:
      p_file LIKE rlgrap-filename.
    w_file = p_file.
    select .... statement
    OPEN DATASET fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
    LOOP AT t_... INTO fs_....
    write:/ .....
    TRANSFER fs_... TO fname.
    or
    TRANSFER t_... TO fname
    ENDLOOP.
    CLOSE DATASET fname.
    Reward points wisely and if you are benefitted or ask for more detailed explanation if problem not solved.
    Regards Harsh.

  • How to use "Open Stream" command?

    How to use "Open Stream" command in the iTunes application.

    File > Open Stream > Enter a URL > Click OK > Listen. Obviously the URL needs be a valid media source like an mp3 file or a streaming radio station.
    tt2

  • How to use Operating System Commands while using define in sqlplus

    How to use Operating System Commands while using define in sqlplus . The Host OS is Linux
    define report_name=PROD_${host date "+%b"}.html
    The above is not working.
    The output should be 
    define report_name=PROD_JAN.html
    Regards,
    DB

    of course I was talking nonsense: the problem here is the mixing of bind variables and DEFINE variables.
    With the following changes the script should work (the conditions for begin_interval_time are perhaps not what you want):
    variable snap1 number
    variable snap2 number
    variable rptname varchar2(20)
    begin
    SELECT min(snap_id) into :snap1 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
    SELECT max(snap_id) into :snap2 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
    end;
    col file_name_value new_value report_name noprint
    select 'PROD_'|| to_char(sysdate,'MON') || '_' ||  to_char(sysdate,'DD') file_name_value  from dual;
    define  report_type  = 'html'
    define num_days=2
    define begin_snap=:snap1
    define end_snap=:snap2
    @@?/rdbms/admin/awrrpt.sql

  • How can use simpler code?

    How can use simpler code for checking a particular value in a string?
    FIND 'C' IN fg_result ."FOR PAYMENT METHODS "CPRS"
    IF sy-subrc NE 0. FIND 'P' IN fg_result.ENDIF.
    IF sy-subrc NE 0. FIND 'R' IN fg_result.ENDIF.
    IF sy-subrc NE 0. FIND 'S' IN fg_result.ENDIF.
    IF SY-SUBRC = 0.

    Dear Shashank,
    DATA:  GV_SRCH(1)    TYPE   C.
    CASE  GV_SRCH.
      WHEN 'C'.
                      FIND 'C' IN fg_result.
      WHEN 'P'.
                      FIND 'P' IN fg_result
      WHEN 'R'.
                      FIND 'R' IN fg_result
      WHEN 'S'.
                      FIND 'S' IN fg_result
    ENDCASE.
    Regards,
    Abir
    Don't forget to award Points *

  • How to use Create input request Activity

     Hi,
     I want to get inputs from the users .
     I want to display a form were user can select a input from drop down list.
     That selected item i want to store it in a variable and use across the flow.
     How to do that using create input request or is there any other way to do that.

    You should be using "Input Request" to do what you are trying to do.
    Add "Create Input Request" to your workflow
    Configure the question you want the user to see in the Web Console. For example, "Select make of your dream car"
    Add "questions" to your input request. For the "drop-down" selection, chose to add new question of type "Select". This will bring up the dialog box that will allow you to configure the unique ID for your question, the free form text (label) and the list of selection choices to show in the drop-down.
    In the activities that follow "Create Input Request" you can retrieve the actual values that the user chose/typed by looking at the values in the [Workflow.Create Input Request.Task.Questions] table property. It has several columns: Id, Question, Value (that correspond to the fields you've configured)
    If you have Input request with several questions, you can use Select from Table activity to choose the specified question (by ID) that you want the value for. If you have only one question in the input request, you can get to the value (entered by the end user) by referencing this property [Workflow.Create Input Request.Task.Questions.First Row.Value]

  • How to use simple types for table column names ?

    Hi,
    can any one tell how to to use simple types for table column names?
    It is required in internationalizing of webdynpro applications.
    Regards,
    Rajesh

    Hi,
    1: define required column names in <SimpleType>
    2:use the following code to get those values
    3:bind 'text' property of Column headers to context attributes
    4:take a context attribute 'Value' as type of <SimpleType>
    5:set these values to context attributes
    IWDAttributeInfo objAttrInfo=wdContext.getNodeInfo().getAttribute(IPrivate<ViewName>View.IContextElement.VALUE);
    ISimpleTypeModifiable simple=objAttrInfo.getModifiableSimpleType();
    Map m=simple.getEnumerationTexts();
    Collection c=m.values();
    Iterator it=c.iterator();
    if(it.hasNext())
    wdContext.currentContextElement.set<att1>(it.next().toString);
    if(it.hasNext())
    wdContext.currentContextElement.set<att2>(it.next().toString);
    if(it.hasNext())
    wdContext.currentContextElement.set<att3>(it.next().toString);
    Regards
    LakshmiNarayana

  • How to use ignore=check_min_mem Command

    Hi Guru's,
    I was  trying to install Hana on VMware in laptop. But I am having 8GB ram.
    I heard that ignore=check_min_mem command can be used to skip the check.
    Can anyone tell me how  to use this command
    My installation path is  - ./setup.sh /tmp/hanainstdir /tmp/hana.model
    Pl note - I am installing this for my learning purpose.
    Thanks in advance.
    Saurabh Vaidya.

    Hi Atul,
    I had brought the server on rent to install the hana db, but it could not be completed
    I had followed below  steps, Pl let me know  if  these were right or wrong
    1. I had used hana life cycle management to install, I stuckup at stage "Starting the system" (4th step, sub step 2)
    2. how  much time does hana installation takes? ( it took almost 4 hrs) but could not start the system
    3. When I used "Top" command, I could see processes with something like (hdbindexserver, hdbpageserver......) was it going on well?
    Thanks in Advance
    Saurabh Vaidya

  • How to use do varying command

    Hi all,
    DATA: BEGIN OF i_mgmt OCCURS 0,
           btrtl     TYPE pa0001-btrtl,
           btext     TYPE t001p-btext,
           perm      TYPE pad_amt7s ,
           con       TYPE pad_amt7s ,
           perm2     TYPE pad_amt7s ,
           con2      TYPE pad_amt7s ,
           perm3     TYPE pad_amt7s ,
           con3      TYPE pad_amt7s ,
           tot       TYPE pad_amt7s ,
           avg       TYPE pad_amt7s ,
          END OF i_mgmt.
    This my int. table and i need to calculate tot. row wise How can i use do varying command in this condition. Or any other way to calculate tot. row wise...Plesae help me
    Thanks.

    Hi,
    Check this example program how to use DO VARYING ..
    REPORT ZTEST_NOTEPAD.
    DATA: BEGIN OF text,
            word1 TYPE c LENGTH 4 VALUE 'AAAA',
            word2 TYPE c LENGTH 4 VALUE 'BBBB',
            word3 TYPE c LENGTH 4 VALUE 'CCCC',
            word4 TYPE c LENGTH 4 VALUE 'DDDD',
          END OF text.
    DATA: word  TYPE c LENGTH 4,
          char1 TYPE c LENGTH 1,
          char2 TYPE c LENGTH 1,
          leng TYPE i.
    FIELD-SYMBOLS <word> LIKE text-word1.
    DATA inc TYPE i.
    DESCRIBE FIELD text LENGTH leng IN CHARACTER MODE.
    leng = leng / 2.
    DO leng TIMES VARYING char1 FROM text(1)
                                NEXT text+2(1) RANGE text
                  VARYING char2 FROM text+1(1)
                                NEXT text+3(1) RANGE text.
      WRITE: char1, char2.
      char1 = 'x'.
      char2 = 'y'.
    ENDDO.
    DO 4 TIMES VARYING word FROM text-word1 NEXT text-word2.
      WRITE / word.
    ENDDO.
    DO.
      inc = sy-index  - 1.
      ASSIGN text-word1 INCREMENT inc TO <word> RANGE text.
      IF sy-subrc = 0.
        WRITE / <word>.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
    Thanks
    Venkat.O

  • How to use SIMPLE CDC log MINER in ODI ?

    Can you please let me the step to do the simple cdc using log miner

    ya that link only tells us about consistent set journalizing . i want to know how to do simple journalizing using log miner ?
    when we import the JKM Oracle 11g Consistent (LOGMINER) . we can select in the KM if we want to use simple set or consistent set
    I am getting an error at the lock Journalizing step .
    update     schema_name.J$S_TRG
    set     JRN_CONSUMED = '1'
    where     (1=1)
    AND JRN_SUBSCRIBER = 'SUNOPSIS' /* AND JRN_DATE < sysdate */
    i check the J$S_TRG table it does not have the jrn_consumed and jrn_subscriber column names in it .
    error message
    904 : 42000 : java.sql.SQLException: ORA-00904: "JRN_SUBSCRIBER": invalid identifier

  • How to use Runtime.getRuntime("command") in win?

    I dont know how to use this method in win entironment, for example about file opertions, where there is some documents on detail about it?

    Huh?
    There is a method called Runtime.getRuntime(). It does not take any parameters. The javadocs describe it.
    Is that what you are asking about?

  • How to use this backup command

    I am learning about solaris backup, I found three useful backup command, I am confusing about them, can not find
    explanation on the man page
    ufsdump 0f - / | ( cd /cop/0 ; ufsrestore -rf - )
    ufsdump 0f - /export/home | ( cd /cop/7 ; ufsrestore -rf - )
    installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0
    I try first two commands, they are works, my questions are,
    1 The hyphen dumps the data to standard output, what is the standard output?
    2 why use the ufsrestore -rf -
    3 when I finish the first command, there is nothing record in the /etc/dumpdates, why?
    4 it seems they are useful to copy from disk to disk, but , when I restore data,
    will I use the command ufsrestore as usual?
    5 currently, in the real world, what kind of backup command do you use in your
    company? Because many books give me command of backuping data to tape,
    are you still using tape nowadays? or do you backup data to hard disk instead of
    tape?
    appreciated for any help, thanks
    Edited by: user8117130 on Jul 2, 2011 9:14 PM

    Where to begin..
    Well, question 1 and 2:
    The commands you found are commands which were used to copy the entire root disk, as well as the partition /export/home to a new disk.
    Apparently the person who first used them had a new harddrive, which he (or she) partitioned and mounted under /cop/ . He (or she) then copied all the data from the / and /export/home partitions to the new disk.
    Hence the use of ufsrestore.
    There are two outputs, standard output (also referred to as - or STDOUT) and standard error.
    Any normal output from any command (such as 'ls') is sent to STDOUT . You can redirect data from STDOUT to a file by using >, i.e:
    ls > /tmp/output.ls
    STDERR is where error messages go.
    Apart from STDOUT and STDERR you also have something called STDIN (or Standard Input), which is used to feed data to a command.
    Just as you can use > to send STDOUT, you can use < to send STDIN, i.e:
    cat < /tmp/output.ls
    In the example you posted with ufsdump/ufsrestore the use read the content of a partition with ufsdump, then send it through a pipe to ufsrestore, which writes it down at a different place. The result is that the user gets a copy of the / disk under /cop/0 .
    As such thats not a backup command, its a way of copying a disk.
    Question 3:
    Because there is no 'u' option, to update /etc/dumpdates you need to use the u argument to ufsdump, in your example:
    ufsdump 0fu - /
    Question 4:
    Well. There are two ways to do a ufsdump to a disk, one way is to do it the way you did it, by piping it to ufsrestore. In that case you can't restore your files using ufsrestore, since they are already copied to the disk.
    The second way to use ufsdump to a disk is to write the entire dump to a file, i.e.:
    ufsdump 0fu /path/to/ufsdump_of_root.dmp /
    Then you can restore a file using ufsrestore, to use an interactive restorer:
    ufsrestore fi /path/to/ufsdump_of_root.dmp
    Question 5:
    Most companies i have worked at uses a mix, some backups are written to disks and some to tape. In particular the short term backups (in the time frame one week to one month) are disk based and everything else (one month to ten years) are tape-based.
    But it really depends on what kind of data it is and what legal requirements you have. If you have to store data for a few years disk backups are not really an option. The benefits of tape backups are that they are quite fast (in particular LTO5), they don't really consume any electricity and you can easily enlarge your archive by buying more tapes.
    I once calculated how many harddrives i would need to store 10 years of backups online. I don't remember how many harddrive i needed (but it was 100TB +), but it would require about 10-15kW of electricity...
    Harddisk backups was popular a while ago, but i think tape is coming back, at least thats my impression.
    .7/M.

  • How to use Action/Input maps

    It seems to me that the move to sharing actions menus, buttons, and other components is a logical one, given that it is desirable to have all references to the action reflect its enabled state.
    The question that arises is: which ActionMap object to use as the central store? Do you create your own and pass it on somewhere?
    And, if you try to do anything with homegrown InputMaps then the components stop seeing the events. I wish there was a definitive YOU MUST DO IT THIS WAY tutorial.
    Why is there no factory API that can create UI components pre-attached to actions and with accelerators or mnemonics already set? Then we would not need to write half the code we do now. My solution:
    public class ComponentFactory {
       ActionMap myMap;
       public ComponentFactory(ActionMap map) {
          myMap = map;
       public JButton createButton(String actioncommand) {
           Action a = myMap.get(actioncommand)
           if(a==null)
              return null;
           return new JButton(a);
       public JMenuItem createMenuItem(String actioncommand) {
        // etc...
       public void setAction(Action a) {
           myMap.put(a.getValue(ACTION_COMMAND_KEY),a);
       public void setEnabled(String actioncommand, boolean state) {
           Action a = myMap.get(actioncommand);
           if(a!=null)
               a.setEnabled(state);
    }Is there any concensus as to the best way to handle ActionMaps/InputMaps?

    Hugh,
    >
    The tutorial is a touch short on this subject, whilst
    it is good on how to create and use actions with
    toolbars and the like, the section on InputMaps and
    ActionMaps is far too brief to get the wider picture.
    The API docs on the same is about one paragraph's
    worth.okay, I just checked the tutorial - it's a bit short on the inputMap/actionMap indeed.
    >
    You are mixing up two different issues:
    a) customize a button with an action
    b) bind a keyStroke to an action for an arbitrary
    jComponent
    a) has nothing to do with b)If b) has nothing to do with a) why have MNEMONIC_KEY
    and ACCELERATOR_KEY on the action?Hmm... where do you see a contradiction to my statement? Those keys are part of a) as they are used for customization of the AbstractButtons: the button's mnenmonic/accelerator properties are set to the corresponding values of the action. This propertyChange triggers an update of the keyBinding to the button's "pressed"/"doClick" actions as registered in the actionMap. They are never used (at least not internally by Swing) for b)
    Historically the action is older than the inputMap/actionMap: basically it's an ActionListener (which is more or less a command pattern) plus some (view) state. This "plus" was designed right in the beginning of Swing for a) to enable state sharing between different "buttons" but not really integrated until version 1.4. parallel to that the need for a general mechanism of binding between keyStrokes and "commands" became obvious and inputMap/actionMap were introduced in 1.3. The only action state that's needed for this mechanism to work is the enabled property. All values are ignored - so currently they somehow appear to be overloaded in the context of the inputMap/actionMap. Personally I think they are very powerful because of this extra flexibility.
    >
    There is still not a single diagram; and I maintain
    that it is less than useful to beginners who are not
    familiar with the terminology used. Well, IMO diagrams are not everything - I still think it much easier to understand than the dnd spec or the focus spec f.i.
    >
    you are free to use whatever object you want as akey
    - write a utility method to use the name, if feellike
    doeing so. There is nothing in the framework that
    would single out the name as "the" key to use, The keybindings document specifically states:
    "New actions can be added to a component equally
    easily."
    "The conventional key for an action is it's
    name." If there is a conventional way then it
    should be encouraged with an appropriate API. I get your point. And I definitely agree on following a convention if there is one. Except when the convention is quite immature (to formulate mildly) - and not even followed by Swing internally: most of the default actions registered in the actionMap don't even have a name, the binding is done by string literals ... duplicated in at least two places: the XXLookAndFeel and the ui-delegates.
    Greetings
    Jeanette

  • How to:  using the Place command in an action and remembering the source filename...

    I have a large set of product, architecture, and other subject-specific photos, that I’m preparing for a new website; all to be placed in various galleries.
    For each photo, I want it to have the same background.  If I were doing this manually, I would simply “place” the subject photo into the background, and save it – back to the original photo name.
    In other words, doing this manually, PRODUCT_001.TIF gets placed into STANDARD_BKGRND.TIF, (thereby automatically correctly sizing and centering it), and then saving the result back to PRODUCT_001.TIF; either overwriting the original, or into a new folder.   (I have the original file somewhere else, and am working with an intermediate copy).
    But since I have several hundred photos, how do I create an action (and really – a droplet) that will save the resulting file to the desired name?  Typically placing photo ‘PRODUCT_001’ into photo ‘B’, alters photo ‘STANDARD_BKGRND’, so I can’t save the result back to ‘PRODUCT_001’.  Said differently, in a droplet, each time it's run saves the result back to the same filename 'STANDARD_BKGRND'.
    The end result – I want to apply that droplet to all the PRODUCT_***.TIF files in a given folder, and end up with the same file names as before.
    Thanks in advance for your help!
    Jerry
    PS - I have no scripting experience in PS, but have written code in other applications/scenarios. 

    Actions don't have access to the document name (where the file name is).  Scripts do, however.
    If your products are sequentially numbered, you're in luck.  You can overide the "Save as command" and make sure that your naming uses a sequence which you can set to the same starting number as your product. Here is an example of how to configure File -> Automate -> Batch (assume the set and action are your hand built one)
    Instead of "Document name" you'd type "PRODUCT_" per your example and choose a 3 digit Serial number.
    The "Starting Serial #" is where you can change if your products are numbered say, 101 and up.

  • How to use cvs checkout command in java

    Hi,
    I am using Ubuntu
    I have installed cvs client in ubuntu
    I have one problem running 'cvs checkout' command through java..
    "cvs" -d ":ext:[email protected]:/var/cvs" co -P "Auto/test"
    When i run the above command in terminal, i got one prompt like '[email protected]'s password:' in the terminal if i give the valid password the folder 'Auto' checked out successfully..
    I have tried following steps but i don't know how to give the password to the terminal using java
    First i created the 'checkout.sh' file.
    In this i have typed "cvs" -d ":ext:[email protected]:/var/cvs" co -P "Auto/test"
    Then i call it using java by the following code
    =================================================================
    String cmd[] = {"bash","checkout.sh"};
    Runtime.getRuntime().exec(cmd).waitFor();
    =================================================================
    Anyone let me know how do I achieve this in java?
    Thanks in Advance
    Kulandaivelu

    masijade. wrote:
    PhHein wrote:
    Maybe you need to modify your links to be more obvious :P
    [*>>klick me<<*|http://www.jcvs.org/]
    Nah! Attention to detail is one of most crucial attributes for a programmer in any language. ;-)
    Edit: The urls seemingly don't like h1 and color tags. ;-)Nope, they don't and I couldn't be bothered to try.
    Gratz on Gold!

Maybe you are looking for

  • How to publish a servlet class to web server?

    background: web server: tomcat apache 4 context path: webapp\test\ servlet path: webapp\test\WEB-INF servlet name: HelloWorld.class i tried to placed the servlet class file to above servlet path, but i can't invoke the servlet by http://localhost:808

  • Refering alias of a function result in an sql statement

    Dear Sir, How to refer an alias of a function result in sql statement? eg.(new_name is the alias) select myfunction(name) new_name from mytable where new_name = '#vincent#'; I can't refer new_name in the above statement coz it gives an error "invalid

  • Oracle hardware and storage solution configuration questions

    Hi all, I am configuring hardware and the storage solution for a project and am hoping to have some questions answered about using Oracle as the storage solution. The current setup will have 2 Dell NX3100 NAS gateways each with dual quad core process

  • Using cookies through PI

    Hi Scenario: Ext System -> SAP PI -> SAP backend. Problem: User credentials contained in cookie in SOAP request to SAP PI should be forwarded and used to log on to SAP backend system. How to propagate the user credentials in the cookie and what adapt

  • False links in emails

    I made the stupid mistake of clicking on a link in a phishing email. Is there any way I can check that I haven't got some malware on my Mac? I can't see anything in downloads, so hopefully I haven't. Thanks in advance.