Concrete class in Java Last Updated : 16 Jan, 2019 Comments Improve Suggest changes Like Article Like Report A concrete class is a class that has an implementation for all of its methods. They cannot have any unimplemented methods. It can also extend an abstract class or implement an interface as long as it implements all their methods. It is a complete class and can be instantiated. In other words, we can say that any class which is not abstract is a concrete class. Necessary condition for a concrete class: There must be an implementation for each and every method. Example: The image below shows three classes Shape, Rectangle and Circle. Shape is abstract whereas Rectangle and Circle are concrete and inherit Shape. This is because Rectangle and Circle implement area() method. Example 1: The below code shows a simple concrete class: Java // Java program to illustrate concrete class // Concrete Class class Main { // this method calculates // product of two numbers static int product(int a, int b) { return a * b; } // this method calculates // sum of two numbers static int sum(int a, int b) { return a + b; } // main method public static void main(String args[]) { int p = product(5, 10); int s = sum(5, 10); // print product System.out.println("Product: " + p); // print sum System.out.println("Sum: " + s); } } Output: Product: 50 Sum: 15 Example 2: The code below illustrates a concrete class which extends an abstract class. The method product() in interface X is implemented by class Product but it does not implement method sum(), therefore it has to be abstract. Whereas class Main implements the unimplemented method sum(), therefore there are no unimplemented methods. Hence, it is a concrete class. Java // Java program to illustrate concrete class // This is an interface interface X { int product(int a, int b); int sum(int a, int b); } // This is an abstract class abstract class Product implements X { // this method calculates // product of two numbers public int product(int a, int b) { return a * b; } } // This is a concrete class that implements class Main extends Product { // this method calculates // sum of two numbers public int sum(int a, int b) { return a + b; } // main method public static void main(String args[]) { Main ob = new Main(); int p = ob.product(5, 10); int s = ob.sum(5, 10); // print product System.out.println("Product: " + p); // print sum System.out.println("Sum: " + s); } } Output: Product: 50 Sum: 15 Comment More infoAdvertise with us Next Article Concrete class in Java S Shivam_72 Follow Improve Article Tags : Java java-basics Java-Object Oriented Java-Classes Practice Tags : Java Similar Reads Collections Class in Java Collections class in Java is one of the utility classes in the Java Collections Framework. The java.util package contains the Collections class in Java. The Java Collections class is used with the static methods that operate on the collections or return the collection. All the methods of this class 13 min read Abstraction in Java Abstraction in Java is the process of hiding the implementation details and only showing the essential details or features to the user. It allows to focus on what an object does rather than how it does it. The unnecessary details are not displayed to the user.Key features of abstraction:Abstraction 10 min read Object Class in Java Object class in Java is present in java.lang package. Every class in Java is directly or indirectly derived from the Object class. If a class does not extend any other class then it is a direct child class of the Java Object class and if it extends another class then it is indirectly derived. The Ob 7 min read Java.Lang.Double Class in Java Double class is a wrapper class for the primitive type double which contains several methods to effectively deal with a double value like converting it to a string representation, and vice-versa. An object of the Double class can hold a single double value. Double class is a wrapper class for the pr 4 min read Static class in Java Java allows a class to be defined within another class. These are called Nested Classes. Classes can be static which most developers are aware of, henceforth some classes can be made static in Java. Java supports Static Instance Variables, Static Methods, Static Block, and Static Classes. The class 3 min read Like