Posts

Showing posts from December, 2023

Java OOPC -Class, Variables, Methods, Modifiers ,Main Methods

Image
  Class Boundary of a class means that in a class except the methods, other whole things we tell  it boundary of a class. Class, constructor, and main method comes under the class boundary. Other methods also inside of the class but we did not consider it as boundary of the class. in here according to the above coding except the ' testmethod'  comes under the boundary of the class.                                     Variables   In Java, variables are containers for storing data values. Each variable has a specific data type, which determines the kind of data it can hold.   There are two main data variable types. 1.static variables 2. non-static variables   Static Variables Using ‘static’ keyword these variables are created , and can access in any place in the inside of the class. It is fact that the Local variable cannot be a static variable. ...

Java OOPC - Object Generation, Data Types, Parameters and Arguments

Image
      Object Generation Object generation in java is the process of creating objects of a class. Using class reference and using class constructor object is generated . They are created using the new keyword followed by a constructor. We can create any number of object for specific class and there is no limit for it. Object add more reliable code. public class ObjectGenerationExample {     public static void main(String[] args) {         // Creating objects         Car car1 = new Car();         Car car2 = new Car();           // Using objects         car1.displayInfo();         car2.displayInfo();     } }  Data Types Java is a statically-typed programming language, which means that the data types ...

Java OOPC -Coding Standards ,Object and Class

Image
    Java Coding Standards   Why coding standards for java?   Standards in java code, we can mention it also as coding conversions or style guidelines. Those are essential in many ways, but in the first place it’s for identity purpose . Programmers follow those regulations for give code to quality, readability, maintainability and collaboration aspects of Java code. Here are some key reasons why standards in java code are important. 1.Readability Coding standards ensure that code is written in a consistent manner throughout a project. This consistency makes it easier for developers to read and understand the code.   2.Maintainability When developers follow a consistent style, it becomes simpler to identify and fix bugs.   3.Collaboration In a collaboration development environment ,multiple developers work on same project .Coding standards facilitate collaboration by providing a shared set of guidelines, ensuring that team members can understand each other’...