summaryrefslogtreecommitdiff
path: root/yaksh/java_files
diff options
context:
space:
mode:
authoradityacp2016-06-20 14:50:08 +0530
committeradityacp2016-07-28 15:56:05 +0530
commit542f862445b65f56704009e324ed39a7eec23dad (patch)
tree7d82a637fde6235b0cb2ffe68e2511b1d1e4e670 /yaksh/java_files
parentcd0da16c708e9c80940f4d531b09b67358bda755 (diff)
downloadonline_test-542f862445b65f56704009e324ed39a7eec23dad.tar.gz
online_test-542f862445b65f56704009e324ed39a7eec23dad.tar.bz2
online_test-542f862445b65f56704009e324ed39a7eec23dad.zip
java file based script
Diffstat (limited to 'yaksh/java_files')
-rw-r--r--yaksh/java_files/read_file.java26
1 files changed, 26 insertions, 0 deletions
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 <E> 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);
+ }
+}