├── Abstraction ├── .idea │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── Abstraction.iml ├── out │ └── production │ │ └── Abstraction │ │ ├── Animal.class │ │ ├── Dog.class │ │ └── Test.class └── src │ └── Test.java ├── CompileTimePolymorphism ├── .idea │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── CompileTimePolymorphism.iml ├── out │ └── production │ │ └── CompileTimePolymorphism │ │ ├── AddNumbers.class │ │ └── Mathematics.class └── src │ └── Mathematics.java ├── Encapsulation ├── .idea │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── Encapsulation.iml ├── out │ └── production │ │ └── Encapsulation │ │ └── Demo.class └── src │ └── Demo.java ├── Inheritance ├── .idea │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── Inheritance.iml ├── out │ └── production │ │ └── Inheritance │ │ ├── Animal.class │ │ ├── Dog.class │ │ └── Test.class └── src │ └── Test.java ├── README.md └── RunTimePolymoraphism ├── .idea ├── misc.xml ├── modules.xml └── workspace.xml ├── RunTimePolymoraphism.iml ├── out └── production │ └── RunTimePolymoraphism │ ├── Animal.class │ ├── Dog.class │ ├── Puppy.class │ └── Test.class └── src └── Test.java /Abstraction/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Abstraction/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Abstraction/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 | 43 | 44 | 45 | 50 | 51 | 52 | 53 | 54 | true 55 | DEFINITION_ORDER 56 | 57 | 58 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 113 | 114 | 115 | 116 | 121 | 122 | 123 | 135 | 136 | 137 | 149 | 150 | 151 | 152 | 166 | 167 | 168 | 169 | 170 | 176 | 177 | 178 | 179 | 197 | 203 | 204 | 205 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 1521815942102 225 | 230 | 231 | 232 | 233 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 271 | 272 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | -------------------------------------------------------------------------------- /CompileTimePolymorphism/CompileTimePolymorphism.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CompileTimePolymorphism/out/production/CompileTimePolymorphism/AddNumbers.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SalithaUCSC/Java-OOP/873615205c67d185296c7f525a469acec6209663/CompileTimePolymorphism/out/production/CompileTimePolymorphism/AddNumbers.class -------------------------------------------------------------------------------- /CompileTimePolymorphism/out/production/CompileTimePolymorphism/Mathematics.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SalithaUCSC/Java-OOP/873615205c67d185296c7f525a469acec6209663/CompileTimePolymorphism/out/production/CompileTimePolymorphism/Mathematics.class -------------------------------------------------------------------------------- /CompileTimePolymorphism/src/Mathematics.java: -------------------------------------------------------------------------------- 1 | class AddNumbers { 2 | 3 | // method with 2 integer parameters 4 | public int addition(int x, int y){ 5 | return x+y; 6 | } 7 | // method with 3 integer parameters 8 | public int addition(int x, int y, int z){ 9 | return x+y+z; 10 | } 11 | // method with 2 integer and double parameters 12 | public int addition(double x, int y){ 13 | return (int)x+y; //casting 14 | } 15 | } 16 | 17 | class Mathematics{ 18 | public static void main(String args[]){ 19 | AddNumbers a1 = new AddNumbers(); 20 | System.out.println(a1.addition(1,2)); 21 | System.out.println(a1.addition(1,2, 3)); 22 | System.out.println(a1.addition(3,4)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Encapsulation/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Encapsulation/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Encapsulation/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 35 | 36 | 37 | 40 | 41 | 42 | 48 | 49 | 50 | 51 | 52 | true 53 | DEFINITION_ORDER 54 | 55 | 56 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 119 | 120 | 121 | 122 | 127 | 128 | 129 | 141 | 142 | 143 | 155 | 156 | 157 | 169 | 170 | 171 | 172 | 186 | 187 | 188 | 189 | 190 | 196 | 197 | 198 | 199 | 217 | 223 | 224 | 225 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 1521812476907 250 | 255 | 256 | 257 | 258 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 295 | 296 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | -------------------------------------------------------------------------------- /Inheritance/Inheritance.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Inheritance/out/production/Inheritance/Animal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SalithaUCSC/Java-OOP/873615205c67d185296c7f525a469acec6209663/Inheritance/out/production/Inheritance/Animal.class -------------------------------------------------------------------------------- /Inheritance/out/production/Inheritance/Dog.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SalithaUCSC/Java-OOP/873615205c67d185296c7f525a469acec6209663/Inheritance/out/production/Inheritance/Dog.class -------------------------------------------------------------------------------- /Inheritance/out/production/Inheritance/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SalithaUCSC/Java-OOP/873615205c67d185296c7f525a469acec6209663/Inheritance/out/production/Inheritance/Test.class -------------------------------------------------------------------------------- /Inheritance/src/Test.java: -------------------------------------------------------------------------------- 1 | class Animal{ 2 | int age = 5; 3 | void eat(){ 4 | System.out.println("Animal eats"); 5 | } 6 | void sleep(){ 7 | System.out.println("Animal sleeps"); 8 | } 9 | } 10 | class Dog extends Animal{ 11 | void bark(){ 12 | System.out.println("Dog barks"); 13 | } 14 | } 15 | 16 | class Test{ 17 | public static void main(String args[]){ 18 | Dog dog = new Dog(); 19 | // call methods from super class 20 | dog.sleep(); 21 | dog.eat(); 22 | // call method from sub class 23 | dog.bark(); 24 | // get attribute value from super class 25 | System.out.println("Age : " + dog.age); 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java-OOP 2 | ### Example applications done using Object Oriented Programming in JAVA.. 3 | 4 | 5 | ![java](https://user-images.githubusercontent.com/23145752/37839216-e2ce22ca-2edf-11e8-96f7-3629b2b164ad.jpg) 6 | 7 | -------------------------------------------------------------------------------- /RunTimePolymoraphism/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RunTimePolymoraphism/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RunTimePolymoraphism/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | 45 | 46 | 47 | 53 | 54 | 55 | 56 | 57 | true 58 | DEFINITION_ORDER 59 | 60 | 61 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |