/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1.  

2.  

3. public class ConsoleApp

4.  

5.   public static void main( String[] args ) 

6.   { 

7.     java.util.Scanner sc = new java.util.Scanner( System.in ); 

8.     System.out.println( "Type a line and press Enter" ); 

9.     String ln = sc.nextLine(); 

10.  

11.     ln = ln.toUpperCase(); 

12.     System.out.print( "Uppercase : " ); 

13.     System.out.println( ln ); 

14.  

15.     System.out.println("Type some words, last word 'bye' "); 

16.     String w = sc.next(); 

17.     while ( ! w.equalsIgnoreCase("bye") ) 

18.     { 

19.       System.out.println( w ); 

20.       w = sc.next(); 

21.     } 

22.     System.out.println("Type one number without fraction"); 

23.     int nr = sc.nextInt(); 

24.     nr = nr * 2

25.     System.out.println( "Doubled : " + nr ); 

26.  

27.     System.out.println( "Finished" ); 

28.   } 

29.

30. //    sc = new Scanner( new File( "some.txt" ) ); 

31. /* 

32. - move to folder containing source, fe: 

33. c: 

34. cd \work\java 

35. - then compile 

36. "C:\Program Files\Java\jdk1.5.0_06\bin\javac" ConsoleApp.java 

37. - and run 

38. "C:\Program Files\Java\jdk1.5.0_06\bin\java" ConsoleApp 

39. */