-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathInputOutputLecture.java
48 lines (39 loc) · 1.5 KB
/
InputOutputLecture.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import javax.xml.transform.Source;
public class InputOutputLecture {
public static void main(String[] args) {
// Input- Command line arguments
// System.out.println(args[1]);
// Input- Using Scanner Class
// Scanner scan = new Scanner(System.in);
//int a = scan.nextInt();
// String st = scan.nextLine();
// System.out.println("Your entered value is " + st);
// char ch = scan.next().charAt(1);
// System.out.println("Your Enterd Value is "+ch);
// Input- Using BufferedReader
// BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
// try {
// String input = reader.readLine();
// System.out.println("Your input = "+input);
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//Output - print, println, printf, format, err
// System.out.print("Shivam");
// System.out.println("Sharma");
// float n = 5.2222232f;
// System.out.printf("%10.5f",n);
//Date Format
System.out.println(new Date());
SimpleDateFormat ft = new SimpleDateFormat("dd-MM-yyyy");
String str = ft.format(new Date());
System.out.println("Formatted Date : " + str);
}
}