I have 3 Classes Circle, Rectangle and Square
I want to get required data for each of above classes and create them by user .
It me
you can use the concept of inheritance to do this. for example, create a Shape class and then make the other classes inherit:
public abstract class Shape {
public int calculateArea();
}
public class Circle extends Shape {}
public class Square extends Shape {}
public class Rectangle extends Shape {}
Then, you can use list of Shape.