Example usage for java.lang System in

List of usage examples for java.lang System in

Introduction

In this page you can find the example usage for java.lang System in.

Prototype

InputStream in

To view the source code for java.lang System in.

Click Source Link

Document

The "standard" input stream.

Usage

From source file:com.orchestrationexample.registerinfoservice.server.Server.java

public static void main(String args[]) throws Exception {
    new ClassPathXmlApplicationContext("server-context.xml");
    System.in.read();
}

From source file:BigIntegerTest.java

public static void main(String[] args) {
    Scanner in = new Scanner(System.in);

    System.out.print("How many numbers do you need to draw? ");
    int k = in.nextInt();

    System.out.print("What is the highest number you can draw? ");
    int n = in.nextInt();

    /*//  w w w  . jav a2 s . c o m
     * compute binomial coefficient n*(n-1)*(n-2)*...*(n-k+1)/(1*2*3*...*k)
     */

    BigInteger lotteryOdds = BigInteger.valueOf(1);

    for (int i = 1; i <= k; i++)
        lotteryOdds = lotteryOdds.multiply(BigInteger.valueOf(n - i + 1)).divide(BigInteger.valueOf(i));

    System.out.println("Your odds are 1 in " + lotteryOdds + ". Good luck!");
}

From source file:TryThread.java

public static void main(String[] args) {
    Thread first = new TryThread("A ", "a  ", 200L);
    Thread second = new TryThread("B ", "b ", 300L);
    Thread third = new TryThread("C ", "c ", 500L);
    System.out.println("Press Enter when you have had enough...\n");
    first.start();/*from w w w .  ja v  a 2 s.  c o m*/
    second.start();
    third.start();
    try {
        System.in.read();
        System.out.println("Enter pressed...\n");
    } catch (IOException e) {
        System.out.println(e);
    }
    return;
}

From source file:com.alibaba.dubbo.examples.async.AsyncProvider.java

public static void main(String[] args) throws Exception {
    String config = AsyncProvider.class.getPackage().getName().replace('.', '/') + "/async-provider.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();//from   ww w.ja v a  2  s  .com
    System.in.read();
}

From source file:com.alibaba.dubbo.examples.cache.CacheProvider.java

public static void main(String[] args) throws Exception {
    String config = CacheProvider.class.getPackage().getName().replace('.', '/') + "/cache-provider.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();//from  w  ww.j  ava  2  s. c  om
    System.in.read();
}

From source file:com.alibaba.dubbo.examples.merge.MergeProvider.java

public static void main(String[] args) throws Exception {
    String config = MergeProvider.class.getPackage().getName().replace('.', '/') + "/merge-provider.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();/*from   w w w .  j  a v  a 2  s  . c  o  m*/
    System.in.read();
}

From source file:com.alibaba.dubbo.examples.merge.MergeProvider2.java

public static void main(String[] args) throws Exception {
    String config = MergeProvider2.class.getPackage().getName().replace('.', '/') + "/merge-provider2.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();/*w ww .j ava  2s  .  co m*/
    System.in.read();
}

From source file:com.jeffy.hdfs.compression.StreamCompressor.java

public static void main(String[] args) throws ClassNotFoundException, IOException {
    ////  w  w w.  java  2 s  . c o  m
    String codecClassname = args[0];

    Class<?> codecClass = Class.forName(codecClassname);

    Configuration conf = new Configuration();

    CompressionCodec codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, conf);

    CompressionOutputStream out = codec.createOutputStream(System.out);

    IOUtils.copy(System.in, out);

    out.finish();

}

From source file:com.alibaba.dubbo.examples.generic.GenericProvider.java

public static void main(String[] args) throws Exception {
    String config = GenericProvider.class.getPackage().getName().replace('.', '/') + "/generic-provider.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();/*from w  w w .  j  a v a2  s. c om*/
    System.in.read();
}

From source file:com.alibaba.dubbo.examples.version.VersionProvider.java

public static void main(String[] args) throws Exception {
    String config = VersionProvider.class.getPackage().getName().replace('.', '/') + "/version-provider.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();/*w w  w . j a  va  2  s .c o m*/
    System.in.read();
}