Diff bet  args and using BufferedReader(new InputStreamReader(System.in))

What is the differece between getting a string via args and using BufferedReader(new InputStreamReader(System.in))??????
Please help me to know

via argsI presume you mean the command line arguments? Well that'd be the command line arguments: ergo: "Hello World" would be the arguments in: java -cp . Say "Hello World"
System.in is the standard input stream... The console (ie the keyboard) when a java program is run within a "standard" command line environment.
Cheers. Keith.

Similar Messages

  • Timeout for  "new BufferedReader (new InputStreamReader (System.in));"

    BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
    String message = in.readLine();  The above code waits infinitely until the user enter the data from the command line and presses enter key.
    The following code can provide a timeout to the above waiting (it works fine).
    But is there a SIMPLER WAY to provide timeout for above waiting, something like setSoTimeout(int milliseconds) method in DatagramSocket, Socket and ServerSocket classes*?*
    http://www.coderanch.com/t/232213/threads/java/implement-timeout-threads
    =>
    import java.util.Timer;  
    import java.util.TimerTask;  
    import java.io.*; 
    public class test{  
    private String str = "";  
         TimerTask task = new TimerTask(){  
                 public void run(){  
              if( str.equals("") ){  
                   System.out.println( "you input nothing. exit..." );  
                   System.exit( 0 );  
         public void getInput() throws Exception{  
              Timer timer = new Timer();  
              timer.schedule( task, 10*1000 );  
              System.out.println( "Input a string within 10 seconds: " );  
              BufferedReader in = new BufferedReader(  
                   new InputStreamReader( System.in ) );  
              str = in.readLine();  
              timer.cancel();  
              System.out.println( "you have entered: "+ str );   
         public static void main( String[] args ){  
              try{  
                   (new test()).getInput();
              }catch( Exception e ){  
                   System.out.println( e );  
              System.out.println( "main exit..." );  
    }

    No. System.in doesn't have a timeout API. Sockets do.

  • HT4623 Is anybody having trouble with your ringer after installing OS 6.0 and using the new GPS system?

    Is anybody having trouble with your ringer after installing OS 6.0 and using the new GPS system?

    The good (?) news is many people are have OS 6.0.1 wifi problems.
    I could not connect to my home network.  What eventually worked for me (twice now), though it makes no sense, is to go to the particular connection you want to use, hit the little blue arrow on the right to get the details screen.  Scroll down to the bottom and change "HTTP Proxy" from "None" to "Auto".  Then leave the "URL" field that pops up blank. 
    This should not work.  However, it has for me where many other suggestions have not. 
    *shrug*
    Best of luck.

  • What is the diff bet XI and Business connector, backend contracts & Goa?

    hi friends
    what is the diff bet XI and Business connector ,diff bet backend contracts and goa
    i know that XI(for new customers) and business connector for existing customers
    do u think xi and Business Connector perform the same task
    Regards
    Vinny

    Hi Vinny,
    As Khan told, business connector is old technolgy and it has almost same functionlities like in XI.
    both are mainly used for converts idoc's into xml format....
    GOA: Global outline agreemnts mainly used when srm is having multiple backend systems. with reference to GOA ,  we can create local contracts in backend systems ...
    Thanks
    Ravi

  • Diff. bet ABAP  and SAP Query

    HI
    Anybody can explain in detail about ABAP  and SAP Query.....
    And tell me what is the main diff. bet ABAP  and SAP Query...
    Regards
    S.Baskaran

    SAP Query
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
    ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
    To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly.
    Check out these links.
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    ABAP query is mostly used by functional consultants.
    Kindly reward points by clicking the star on the left of reply,if it helps.Kindly close your previous threads if your problem is solved and reward points for helpful answers.
    Don't forget to reward if useful...

  • What is diff bet EDI and XI?

    Hi Friends
    What is diff bet EDI and XI?
    Regards
    Vinny Novice

    "EDI is a technique used to communicate business transactions between computer systems of different companies and organizations. Note that sometimes the EDI mechanism deployed at a company is often used to interface to other systems within the same organization."
    The business data is saved in IDoc format in the IDoc Interface and is forwarded as IDocs. If an error occurs, exception handling is triggered using SAP tasks. The agents who are responsible for these tasks and have the relevant authorizations are defined in the IDoc Interface.
    Features
    The IDoc Interface supports three types of data flow with the external system:
    ·        Outbound processing
    IDocs are transferred to a receiving system from your SAP System.
    ·        Inbound processing
    IDocs are transferred to your SAP System from an upstream system.
    ·        Status processing
    XI
    SAP XI is based on general standards so as to enable external systems to be integrated. At the center of the infrastructure is an XML-based communication that uses HTTP (Hyper Text Transfer Protocol). The application-specific contents are transferred in messages in user-defined XML (eXtensible Markup Language) schema from the sender to the receiver using the Integration Server.
    ●     Modeling and design of messages, transformations, and cross-component integration processes
    ●     Configuration options for managing collaborative processes and message flow
    ●     Runtime for message and process management
    ●     Adapter Engine for integrating heterogeneous system components
    ●     Central monitoring for monitoring message flow and processes
    Thanks

  • What is the diff bet RFX and Bidding Engine?

    Hi Friends
    What is the diff bet RFX and Bidding Engine
    Regards
    Surya

    Hi Surya
    Bidding engine is the component in SAP SRM that we use to conduct RFx adn Live Auctions.
    You can do RFx and Auctions both in SAP SRM and SAP E-Sourcing.
    Inside SRM RFx is also called Bid Invitation.
    In SAP E-Sourcing its called RFx (x could be I=Information, P=Proposal, Q=Quotation)
    Bidding engine is the engine that powers sourcing.
    Hope this clears your doubts
    Regards
    tridip chakraborthy

  • What is the diff bet RFQ and Bidinvitation?

    Hi Friends
    What is the diff bet RFQ and Bidinvitation?
    Regards
    Surya

    Hi Surya
    I have answered this in the previous thread of yours
    RFQ and bid invitation are the same, only that Q will be quotation.
    In SAP terminology RFQ are genertally used in the back end application SAP R/3 (SAP MM)
    RFx (x could be I=Information, P=Proposal, Q=Quotation)
    Hope this clears your doubts
    Regards
    tridip chakraborthy

  • What is diff bet. facade and adapter pattern?

    What is diff bet. facade and adapter pattern?

    An adapter is an interpretor between two classes, it converts the interface of one class so it can be used by another expecting that interface. Adapters are also known to be a concrete class that implements the all interface methods so that objects don't have to produce all interface methods.
    The delegate pattern is the one stop shop that handles requests, and performs those requests on a high number of subsystems. For example, the session bean facade has verb methods that once involked will gather multiple entity beans to perform that one duty.
    Dan

  • What is diff bet PDH and PCH?

    Hi Friends
    what is diff bet PDH and PCH
    PCH::product cat hierarchy
    then what does PDH stand for
    Regards
    Surya

    Hi Surya,
    PCH: is nothing but product category hierachy bascially product categories will maintain using hierachies...per example....
    01-->0102>010203->01020304...low level product categories inherits the characterstics of the higher product category.....
    PDH: is nothing but product hierachy....i don't think this is much usefull
    Thanks
    Ravi

  • I have forgotten icloud account password linked to my ipad. I am unable to reset the password as well as delete this account from my ipad, and use a new one.

    I have forgotten icloud account password linked to my ipad. I am unable to reset the password as well as delete this account from my ipad, and use a new one.                                  

    None of us here, nor Apple, can help you.

  • I have an 2tb time capsule 802.11n Wi-Fi base station can I use this as an external hard drive and use a new airport extreme  802.11ac Wi-Fi for my wifi?

    I have an 2tb time capsule 802.11n Wi-Fi base station can I use this as an external hard drive and use a new airport extreme  802.11ac Wi-Fi for my wifi?

    You can use the 2 TB Time Capsule as a network drive. That means that it must connect to one of the Ethernet LAN <--> ports on the new AirPort Extreme, or connect to the network using wireless.

  • I have an original iPad and downloaded the new operating system.  Now' I cannot write on my Contacts or Calendar apps, and my Pages app (purchased) has lost the ability to use the bold, underline, and italics functions.  Does anyone know how to fix these

    I have an original iPad and downloaded the new operating system.  Now, I cannot add to my contacts or calendar apps, and Pages ( which I purchased) is not allowing me to use the bold, underline, and italics functions.  Does anyone know how to solve this problem?

    No, it stays with the current OS (iOS5 in this case) - Apple doesn't allow downgrading iOS
    If you are syncing to a desktop, you shoudln't lose anything. If you aren't syncing, then that's the first thing you should do, to protect contacts etc.
    the other thing is, when the iPad is connected to iTunes, right-click its name in the Devices list and choose Back Up.
    That way, when yoiu do the restore, everything should come back as was.

  • Where can I learn how to setup and use the new features in Mountain Lion?

    Where can I learn how to setup and use the new features in Mountain Lion?

    MacWorld has a Superguide, TidBITS has Take Control books, and probably a flock of other publishers have physical books.

  • I did a system restore on my iphone 2 and used a new name (Allan 2). Now I need to access my original iphone apps on itunes,  Where do I find my first phone display an itunes? thanks

    I did a system restore on my iphone2 and used a new name for thr phone on ituhes (Allan2).  Now I need to access my saved apps on the original phone name.  How do I find the two phone profiles on itunes.  When I open it with my phone it only shows Allan2. Thanks

    If your apps were in itunes on your computer, then they should still be there.  Just sync them back to the iphone.
    BTW, the backup that itunes performs when syncing does NOT include music/apps/movies/tv shows etc.
    Anything purchased on the iphone would have to be transferred to your computer.  File>Transfer Purchases
    Unlike music/vids/etc, you can redownload apps
    How to redownload purchased apps from the App Store

Maybe you are looking for

  • Pdf viewer/ v1.4.1

    Try this- open a large PDF, zoom in on an area and wait for the Pre to autooff. When I resume, the PDF viewer has crashed.. There is a spinning circle in the top right corner and if you enter a new page number, the total page count disappears. Also,

  • Ntp drift not saved

    Hello everybody! I'm trying to configure ntp server on ASR1002f ( asr1000rp1-advipservicesk9.03.09.01.S.153-2.S1.bin) , but i get a lot of annoying log messages like this: Jul 30 20:14:56.180 MSK: %NTP : Drift Value NTPv4_Drift=0.E68F not saved in pe

  • HT4437 connecting airport to router

    is to better to use a CAT 6 cable or USA cable when connecting to a FIOS router?

  • Send some example of bulk collect option in loop

    Hi I have three type parameter which is bulk collect from same table i want to use two of the parameter to verify the data in other table. and if data won't find using this 3rd bulk collect option to update 3 rd table.. help is appreciated,

  • Content Server & cFolder Integration via Different Application

    Hello, We have cFolder 3.1 and content server. cFolder and Content Server is integrated. User can add file via cFolder & this file will be visible in cFolder. But Customer has a different requirement. They want to upload files to content Server Direc