Write a program in java to demonstrate overloading?

class OverLoading {                 String s1;              //Instance member/Attributes                 int a,b;  //Instance member/Attributes                 public OverLoading()                 {                                 a=7;…

Read More

Write a program in java to demonstrate upcasting?

class UpCasting {                 public static void main(String arg[])                 {                                 int a=9;                                 long l=a;                                 System.out.println(l);…

Read More

Write a program in java to swap two number without third variable in one statement?

public class Swapping {                 public static void main(String arg[])                 {                                 int a=7,b=9;                                 System.out.println(“Before Swapping”);                                 System.out.println(a);…

Read More

Write a program in java to swap two number without third variable?

public class Swap {                 public static void main(String arg[])                 {                                 int a=6,b=7;                                 System.out.println(“Before Swapping”);                                 System.out.println(a);…

Read More