Datatype in JavaIn Java, a data type defines what kind of value a variable can hold and tells the Java Virtual Machine (JVM) how to interpret the variable’s value. Data types in Java are divided into two categories: 1. Primitive Data Types 2. Non-Primitive Data Type...Feb 6, 2025 · 2 min readconstructor-chaining-in-java.hashnode.dev
Variables and Constants in JavaVariables in Java A variable in Java is a container that holds a value of a specific data type. Java is a statically-typed language, which means it is mandatory to declare the data type of a variable before assigning a value. Variables in Java can be...Feb 6, 2025 · 2 min readconstructor-chaining-in-java.hashnode.dev
Class, Object & Anonymous object in JavaWhat is Class? Class is Blue print on an Object, It is not possible to create an object without class. Or Class is logical entity which plays vital role in creating objects. Syntax for creating class in Java class classname { //Attributes of class } ...Feb 5, 2025 · 2 min readconstructor-chaining-in-java.hashnode.dev
Variable ShadowingVariable shadowing occurs when a local variable (declared inside a method, constructor, or block) has the same name as an instance variable (declared at the class level). In this case, the local variable takes precedence within its scope, meaning it ...Feb 5, 2025 · 1 min readvariable-shadowing.hashnode.dev
Variable ShadowingVariable shadowing occurs when a local variable (inside a method, constructor, or block) has the same name and type as an instance variable (declared at the class level). In this case, the local variable takes precedence within its scope. However, yo...Feb 5, 2025 · 1 min readconstructor-chaining-in-java.hashnode.dev