summaryrefslogtreecommitdiff
path: root/yaksh/java_files
diff options
context:
space:
mode:
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);
+ }
+}