-
When to use interfaces and when to use abstract classes?
just one word supscriptioninterface means mediaterabstract means data hiding
-
Use of wrapper classes?
Wrapper classes to exactly what they say, they wrap primitive types (eg: int, double, etc) in Objects which can be placed into Vectors, and many, many other uses.
Notice that an Object starts with a...
-
Why do you use abstract classes in java?
Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain...
-
What is the use of string buffer class?
Strings are extremely useful but at the same time resource intensive too. In programs where numerous strings are used which need to be altered every now and then, it is advisable to use the...
-
Where to use the anonymous class in java?
Anonymous Inner Classes - Type One Check out the following code: class Ferrari { public void drive() { System.out.println("Ferrari"); } } class Car { Ferrari p = new Ferrari() { public void drive() {...