Showing posts with label Static in Java. Show all posts
Showing posts with label Static in Java. Show all posts

58 How to Represents Primitive Data into Wrapper Object by using Methods?

Code: public class Test { public static void main( String args[] ) { byte b1 = 100; short b2 = 200; int b3 = 300; lon...
Read More

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

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