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
Subscribe to:
Posts (Atom)