Java Classes and Objects: Classes and objects both are treated in similar way in all programming languages. Java is not exception. Understanding classes and objects with real world example Consider a physical class room with lot of real world objects. What we Observe in class room..? Chairs Table Students Teacher Black board Markers and Erasers etc So, a programmer needs to instruct the computer, how to create a class room object and it's subsequent objects. like, chair, table, teacher and student etc. If programmer wants to create or develop a School application, he would need to create: class room object Office room object, Student object, Stationary object Play room object etc Let us now create School application with above mentioned objects and classes using java programming language. To create Objects, first of all, we have to create respective classes in java public class School_Application{ public Student students; ...
Write code or write code in right way... Writing a coding solution to a problem can be done in many ways. If the solution can be obtained with less number of code lines, then it is easy to understand and maintain. But what if code is large with having millions of lines. Moreover maintenance and readability becomes difficult as the code base grows... Right? In this blog I want to share my views and experiences on writing code efficiently and effectively with less maintenance efforts. Aspects to consider while coding: Naming convention Cyclomatic Complexity SOLID principles DRY Principle Managing dead code Comments Naming conventions: Every programming language mandates few norms in order to name variables, classes and functions etc. For ex: Java uses class names first letter to be a alphabet and rest to be lower case letters. But if we dig little bit more, naming conventions are not limited to only upper case or lower case letters and using alphanumeric letters etc. Nam...