diff --git a/ContactManager b/ContactManager new file mode 160000 index 0000000..d20288b --- /dev/null +++ b/ContactManager @@ -0,0 +1 @@ +Subproject commit d20288b56bde93c121122dad558cf9060423ca29 diff --git a/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ClassCast.class b/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ClassCast.class index aa5d44b..9d9bd0e 100644 Binary files a/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ClassCast.class and b/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ClassCast.class differ diff --git a/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/Example.class b/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/Example.class index 65d78e9..e294810 100644 Binary files a/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/Example.class and b/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/Example.class differ diff --git a/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ExceptionChecked.class b/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ExceptionChecked.class index 09d46bc..9475506 100644 Binary files a/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ExceptionChecked.class and b/JavaTestMahesh/bin/com/mahesh/exceptionHandelling/ExceptionChecked.class differ diff --git a/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ClassCast.java b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ClassCast.java index 7e4adab..d56d01c 100644 --- a/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ClassCast.java +++ b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ClassCast.java @@ -3,7 +3,7 @@ public class ClassCast { public static void main(String[] args) { try { - Object obj = new Integer(100); + Object obj = new Integer(10); System.out.println((float) obj); } catch (ClassCastException e) { System.out.println("Check the casting"); diff --git a/JavaTestMahesh/src/com/mahesh/exceptionHandelling/Example.java b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/Example.java index dea4f1a..6a1a50b 100644 --- a/JavaTestMahesh/src/com/mahesh/exceptionHandelling/Example.java +++ b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/Example.java @@ -12,6 +12,7 @@ public Example(String message) { static { /* Store the first 10 characters of the input message. */ subMessage = message.substring(0, 10); + } public String getSubMessage() { diff --git a/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ExceptionChecked.java b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ExceptionChecked.java index 698c009..6ae07e0 100644 --- a/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ExceptionChecked.java +++ b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/ExceptionChecked.java @@ -9,17 +9,17 @@ public class ExceptionChecked { public static void main(String args[]) { - String content = "Hello Mahesh"; + String content = "Hello Vishwa"; FileInputStream fis = null; try { - fis = new FileInputStream("C:/Softgen/mahesh.txt"); + fis = new FileInputStream("D:/java programs/vishwa.txt"); } catch (FileNotFoundException fnfe) { System.out.println("The specified file is not " + "present at the given path"); } int k; try { - File file = new File("C:/Softgen/mahesh.txt"); + File file = new File("D:/java programs/vishwa.txt"); // if file doesnt exists, then create it if (!file.exists()) { file.createNewFile(); diff --git a/JavaTestMahesh/src/com/mahesh/exceptionHandelling/VariableDemo.java b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/VariableDemo.java new file mode 100644 index 0000000..f5ef522 --- /dev/null +++ b/JavaTestMahesh/src/com/mahesh/exceptionHandelling/VariableDemo.java @@ -0,0 +1,28 @@ +package com.mahesh.exceptionHandelling; + + +public class VariableDemo { + static int count = 0; + + public void increment(){ + count++; + } + + static{ + System.out.println("Static value"); + } + + public static void main(String[] args) { + VariableDemo obj1 = new VariableDemo(); + VariableDemo obj2 = new VariableDemo(); + System.out.println("Obj1: count is = " + obj1.count); + System.out.println("Obj2: count is = " + obj2.count ); + obj1.increment(); + System.out.println("Obj2: count is = " + obj2.count ); + obj2.increment(); + + System.out.println("Obj1: count is = " + obj1.count); + + } + +} diff --git a/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverloading.class b/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverloading.class index 9037b1c..c46ccb0 100644 Binary files a/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverloading.class and b/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverloading.class differ diff --git a/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverriding.class b/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverriding.class index 124fcaf..f62d724 100644 Binary files a/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverriding.class and b/VishwaCoreJava/bin/com/vishwa/corejava/MethodOverriding.class differ diff --git a/VishwaCoreJava/bin/com/vishwa/corejava/Methods.class b/VishwaCoreJava/bin/com/vishwa/corejava/Methods.class index eca9ada..5477dd2 100644 Binary files a/VishwaCoreJava/bin/com/vishwa/corejava/Methods.class and b/VishwaCoreJava/bin/com/vishwa/corejava/Methods.class differ diff --git a/VishwaCoreJava/bin/com/vishwa/corejava/loops/ForLoopExample.class b/VishwaCoreJava/bin/com/vishwa/corejava/loops/ForLoopExample.class new file mode 100644 index 0000000..b86f370 Binary files /dev/null and b/VishwaCoreJava/bin/com/vishwa/corejava/loops/ForLoopExample.class differ diff --git a/VishwaCoreJava/bin/com/vishwa/corejava/loops/MethodTest.class b/VishwaCoreJava/bin/com/vishwa/corejava/loops/MethodTest.class new file mode 100644 index 0000000..cdeb748 Binary files /dev/null and b/VishwaCoreJava/bin/com/vishwa/corejava/loops/MethodTest.class differ diff --git a/VishwaCoreJava/src/com/vishwa/corejava/MethodOverloading.java b/VishwaCoreJava/src/com/vishwa/corejava/MethodOverloading.java index 5d681d4..28ae960 100644 --- a/VishwaCoreJava/src/com/vishwa/corejava/MethodOverloading.java +++ b/VishwaCoreJava/src/com/vishwa/corejava/MethodOverloading.java @@ -1,5 +1,6 @@ package com.vishwa.corejava; public class MethodOverloading { - + public static void main(String[] args) { + } } diff --git a/VishwaCoreJava/src/com/vishwa/corejava/MethodOverriding.java b/VishwaCoreJava/src/com/vishwa/corejava/MethodOverriding.java index ed001e1..27d6d34 100644 --- a/VishwaCoreJava/src/com/vishwa/corejava/MethodOverriding.java +++ b/VishwaCoreJava/src/com/vishwa/corejava/MethodOverriding.java @@ -1,5 +1,7 @@ package com.vishwa.corejava; public class MethodOverriding { + public static void main(String[] args) { + } } diff --git a/VishwaCoreJava/src/com/vishwa/corejava/Methods.java b/VishwaCoreJava/src/com/vishwa/corejava/Methods.java index db9a8cc..758eb91 100644 --- a/VishwaCoreJava/src/com/vishwa/corejava/Methods.java +++ b/VishwaCoreJava/src/com/vishwa/corejava/Methods.java @@ -5,6 +5,17 @@ public static void main(String[] args) { Methods.sub(99, 55); Methods obj = new Methods(); obj.add(12, 56); + double div = obj.div(12.96, 5.656); + float mul = multi(23f, 54.44f); + System.out.println(mul); + } + + private double div(double d, double e) { + return d / e; + } + + public static float multi(float f, float g) { + return f * g; } public void add(int x, int y) { @@ -14,4 +25,8 @@ public void add(int x, int y) { public static void sub(int x, int y) { System.out.println(x - y); } + + private void multiply() { + + } } diff --git a/VishwaCoreJava/src/com/vishwa/corejava/loops/ForLoopExample.java b/VishwaCoreJava/src/com/vishwa/corejava/loops/ForLoopExample.java new file mode 100644 index 0000000..36f4015 --- /dev/null +++ b/VishwaCoreJava/src/com/vishwa/corejava/loops/ForLoopExample.java @@ -0,0 +1,7 @@ +package com.vishwa.corejava.loops; + +public class ForLoopExample { + public static void main(String[] args) { + System.out.println(); + } +} diff --git a/VishwaCoreJava/src/com/vishwa/corejava/loops/MethodTest.java b/VishwaCoreJava/src/com/vishwa/corejava/loops/MethodTest.java new file mode 100644 index 0000000..bbfa3f4 --- /dev/null +++ b/VishwaCoreJava/src/com/vishwa/corejava/loops/MethodTest.java @@ -0,0 +1,27 @@ +package com.vishwa.corejava.loops; + +public class MethodTest { + + public static void main(String[] args) { + int i = 5; + int j = 2; + // int k = max(i, j); + int x = 10; + + if ((x == 10) || i <= 10) + System.out.println("One"); + + // System.out.println("The maximum between " +i + " and "+ j + " is "+ + // k); + } + // public static int max(int num1, int num2){ + // int result; + // if(num1 > num2) + // result = num1; + // else + // result = num2; + // + // return result; + // } + +} diff --git a/vishwaandroid/ContactManager b/vishwaandroid/ContactManager new file mode 160000 index 0000000..d20288b --- /dev/null +++ b/vishwaandroid/ContactManager @@ -0,0 +1 @@ +Subproject commit d20288b56bde93c121122dad558cf9060423ca29