diff options
author | King | 2016-07-28 17:39:44 +0530 |
---|---|---|
committer | GitHub | 2016-07-28 17:39:44 +0530 |
commit | 2b03aeb36fa333ea1644a248c742cf0c1df12a5f (patch) | |
tree | 4c753ba9a1fbccf3e06d1ed1d998137c88a73b88 /yaksh/java_files | |
parent | 344e1e804cee214c0d0f5c41ca16d871e786d4c3 (diff) | |
parent | 83bee9d89e163e98504c8aa210ce60200bd1cd1d (diff) | |
download | online_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.tar.gz online_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.tar.bz2 online_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.zip |
Merge pull request #113 from adityacp/file_based_questions
File based questions
Diffstat (limited to 'yaksh/java_files')
-rw-r--r-- | yaksh/java_files/read_file.java | 26 |
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); + } +} |