What is the difference between abstraction and polymorphism? What is encapsulation? How to print repeated no. stored in an array? using hash Set , using Hashmap How to swap to string without using third variable ? public class SwapToString { public static void main(String[] args) { // TODO Auto-generated method stub String a="Hellow"; String b="World"; System.out.println("String before swap " + a+ " "+b); a=a+b; b=a.substring(0,a.length()-b.length() ); System.out.println(b); System.out.println(a); System.out.println(a.substring(b.length())); } } ----------------------- o/p String before swap Hellow World Hellow HellowWorld World what and all design pattern you have worked on? What is factory design pattern ? What is singleton design pattern ? How do you create your own singleton class ? How do you create your own immutable class? Why is String immutable? What is the difference between String a="abc"; and String a = new ...
Comments
Post a Comment