Object Reference variable in java

Object Reference Variable: “new” keyword allocate object memory at random location. Non static variable get memory inside object(if any). Constructor initialize(assign values to non static variables) object after creation. After object initialization, constructor returns the …

Non static method in java

Non static method: A method is a block that performs a task. Methods having identities, hence we can call explicitly. Non static methods must be defined without static keyword. We can access the static method …

this keyword in Java

this: It is a keyword. It is called pre-defined non static variable. It holds object address. this = object address; It must be used only in non static context. We can display object address using …

Instance block in java

Non static block: Defining a block without identity. It is also called Instance block or Anonymous block. Instance block executes automatically by the JVM. We cannot access explicitly – because no name to call. It …

Non static members in Java

Non Static Members: The common functionality of application must be defined as static. Non static represents the specific functionality of Object in application. We can define 4 non static members in a class. Constructor Non …

Java codes on static

Write the output: Output it: Any object(class) type variable holds address of object. Pointer variables can hold address. Pointer default value is null, hence any class type variable default value is null.

Static Method in Java

Static user method: Every program is a collection of methods. Main() method is the starting point of application. JVM invokes the main() method automatically. We can define user methods depends on application requirement. Static methods …

Static variables in Java

Static variable: Declaration of variable inside the class and outside to methods and blocks. We must define the variable with static keyword. We access static variable from all methods and blocks. We can access the …

Local variables in Java

Local variable: Declaration of variable inside block or method is called local variable. We can access local variable directly. Local variable must assign with value before its use. We can access local variable after initialization …

static block in java

Static block: A block of instructions with no identity. We just define block with “static” keyword. We cannot access – because no identity. JVM access automatically when class execution starts. Static block executes before main() …

Courses Enquiry Form