From 542f862445b65f56704009e324ed39a7eec23dad Mon Sep 17 00:00:00 2001 From: adityacp Date: Mon, 20 Jun 2016 14:50:08 +0530 Subject: java file based script --- yaksh/java_files/read_file.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 yaksh/java_files/read_file.java (limited to 'yaksh') diff --git a/yaksh/java_files/read_file.java b/yaksh/java_files/read_file.java new file mode 100644 index 0000000..21a5836 --- /dev/null +++ b/yaksh/java_files/read_file.java @@ -0,0 +1,26 @@ +class read_file +{ + public static void check(E expect, E result) + { + if(result.equals(expect)) + { + System.out.println("Correct:\nOutput expected "+expect+" and got "+result); + } + else + { + System.out.println("Incorrect:\nOutput expected "+expect+" but got "+result); + System.exit(1); + } + } + public static void main(String arg[]) + { + String result = ""; + Test t = new Test(); + try{ + result = t.readFile();} + catch(Exception e){ + System.out.print(e); + } + check("2", result); + } +} -- cgit