Code: public class Test { public static void main( String args[] ) { byte b1 = 100; short b2 = 200; int b3 = 300; lon...
Read More
Showing posts with label Static in Java. Show all posts
Showing posts with label Static in Java. Show all posts
57 How to Represents Primitive data into Wrapper Class Object in Java Using Constructor?
Code: public class Test { public static void main( String args[] ) { short s1 = 235; String s2 = "500"; Short s...
Read More
56 How to Represents Primitive Byte data into Wrapper Class Byte Object?
Code: public class Test { public static void main( String args[] ) { byte b1 = 100; Byte b2 = new Byte(b1); System.ou...
Read More
55 What is hashCode() and Equals in java lang Object Class and How to Override their class in Java
How to generate identification number based on Contain? Code: package com.codingatharva; class Student { int sid ; String snam...
Read More
54 Program on Garbage Collection in Java Part:2
Program explain concept like: 1) How after completion of static method the object created inside the block becomes un-referenced in S...
Read More
53 Program on Garbage Collection in Java Part 1
Program explain concept like: 1) When jvm will skips low priority thread 2) Types of Object 3) Memory allocation type Used, Unused...
Read More
52 Program for overloading and print value using function in Java
Code: class Overloading2 { int x , y , z ; Overloading2(int a ) { x = a; } Overloading2(int a , int b) { x = a; ...
Read More
51 Program to demonstrate Overriding in Java
Code: class SuperClass { int a,b; SuperClass(int a) { this.a = a; b = 20; } void display() { System.out.println(...
Read More
50 Program to demonstrate Overloading in Java
Code: class Overloading { int a , b ; Overloading() { a = 10; b = 20; } Overloading(int a , int b) { this.a = a...
Read More
49 Program to perform demonstrate final method in Java.
Code: // Final Method import java.io.*; import java.util.*; class FinalMDemo { static int a = 10 , b = 20; // static final vo...
Read More
48 Program to demonstrate Final Keyword in Java
Code: // Final Keyword class FinalDemo { final int a = 100; public static void main( String args[] ) { FinalDemo f = new ...
Read More
47 Program to perform Abstract Class in Java
Code: abstract class AbstractClass { abstract void display(); } class Demo extends AbstractClass { void display() { System...
Read More
46 Program to implement Wrapper class all methods in Java
Code: class Wrap { public static void main(String args[]) { Integer i = new Integer(10); int b = 123456; // Parse...
Read More
45 Program to add two jagged array in Java
Code: import java.util.*; import java.io.*; class Add { public static void main( String args[] ) throws IOException { Buffere...
Read More
44 Program to use different methods of Vector Class in Java
Code: import java.util.Vector; class VectFun { public static void main( String args[] ) { Vector v = new Vector(); v.addEle...
Read More
42 Where we can use "this" keyword in our Java file?
Code: class Demo { static { } { System.out.println("nsb: " + this.hashCode() ); } Demo() { System.out....
Read More
41 Program to insert different elements in the Vector and display them in Java.
Code: import java.util.vector class Vect { public static void main( String args[] ) { Vector v = new Vector(); int a = 10; ...
Read More
43 What is super keyword and usage of super keyword ?
Code: class SuperClass { int a = 111; static int b = 222; static void m1() { System.out.println(" Super class static m...
Read More
40 Program on 3d array in Java
Code: import java.io.*; import java.util.*; class Arr { public static void main( String args[] ) { int a[][][] = new int[2][4]...
Read More
39 Program to implement all methods of StringBuffer class in Java
Code: class Str { public static void main( String args[] ) { StringBuffer s = new StringBuffer("Coding Atharva"); ...
Read More
Subscribe to:
Posts (Atom)