Type casting: Conversion of data from one data type to another data type. Casting (conversion) happens at runtime. Java allows Primitive casting & Object casting. Casting can be either Implicit (internal) by JVM Explicit (external) …
Character data type: Character type can store characters, symbols and digits. Character represents using ‘single quotes’. Character System: Program is a set of instructions. Instruction consists alphabets, digits and symbols. System converts every instruction into …
Integer types: We have 4 integer types among eight available primitive types in java. We can represent size in bytes of memory. Integer data type values come under positive and negative. Data types allow you …
Data types: In the declaration of every variable, it is mandatory to represent its data type. Data type describes The size of memory allocated to variable. The type of data allowed to store into variable. …
System.out.println(): System is pre-defined class. System contains a static variable called “out” “out” is the object of PrintStrem class type. “out” represents standard output device (monitor) object. PrintStream class: It is belongs to io package. …
Method returning primitive variable: Called function can return the value. We collect these values in the calling method Method returning address of object: Accessing non static method using static object reference variable:
We can pass local variables from one method to another method as parameter. Passing object as parameter: Like primitive data types, we can pass objects as parameters. We need to collect these parameters into Class …
Local variable belongs to the same block in which it has defined. We cannot access local variable of one block from another block. Creating object in static block: After object creation in static block if …
Object initialization: Object stores non static variables. Non static variables automatically initializes with default values. We access these variables using address. Non static variables get memory inside every object and initializes with default values automatically. …
Non static variables: Variable stores information. Static variables store common information of all objects. Non static variables store specific information of object. Static variables get memory only once – sharable data Non static variables get …