In last post, we discussed on exception handling, checked exception. try…catch block helps to handle the exception. Let us discuss DRY principle before discuss on finally block. The DRY(Don’t Repeat Yourself) is a principle of software development aimed to avoid repetition of same code in multiple places.. The DRY principle is stated as, “Every piece
Browsing tag: oops
Recently I had chance to meet my college junior, he said he started learning Java. I appreciated him for learning new programming skill. He is from C programming background, he said it is easy to learn java and he said java looks same like “C programming”. I was shocked. How he claims “Java programming same
An abstract class’s purpose is to provide an appropriate super class from which other classes can inherit and thus share a common design. Abstract class would be created to share code among several closely related classes. All the sub-classes extend the abstract class would get all the common methods or fields available in the super
Object oriented programming(OOPS) paradigm enforces code re-usability and avoid redundant code. To implement the code re-usability, OOPS introduces the concept of inheritance. Let see the “Inheritance” definition, A class that is derived from another class is called a subclass (also a derived class, extended class, or child class). The class from which the subclass is
Having the door would not ensure safety for home. Locking the door is important and ensures the safety of the home. The same analogy applicable for Java object oriented feature as well. Writing a class in java would not provide abstraction and encapsulation. We have to write the code by exposing only the required information
More number of developers are familiar and expert in procedural languages like C and Visual Basic. We can develop the software solution by procedural languages, then why it is required to move to object oriented programming (OOPS)? Why OOPS has better industry reception than procedural languages? Finally why Java runs on billions on devices than