• Register

It is a class that has an implementation for all of its functions. They cannot have any unimplemented functions. It can also inherit an abstract class or apply  an interface as long as it implements  their functions. It is a comprehensive class and can be instantiated.

Concrete class in Java

Example 1: 

The following chunk displays a artless concrete class:

   
class Main1 { 
  
    // this function computes 
    // multiplication of two numb 
    static int product1(int a1, int b1) 
    { 
        return a1 * b1; 
    } 
  
    // this function computes 
    // summation of two numb 
    static int sum1(int a1, int b1) 
    { 
        return a1 + b1; 
    } 
  
    // main function
    public static void main(String args[]) 
    { 
        int p1 = product1(51, 10); 
        int s1 = sum1(51, 10); 
  
        // print multi
        System.out.println("multi: " + p1); 
  
        // print summation
        System.out.println("Summation: " + s1);
    } 
} 

OutCome:

Product: 50

Sum: 15

Example 2

interface X1 { 
    int product(int a1, int b1); 
    int sum1(int a1, int b1); 
} 
  
// it is an abstract class 
abstract class Product1 implements X1 { 
  
    // this function computes
    // multiplication of two numb 
    public int product1(int a1, int b1) 
    { 
        return a1 * b1; 
    } 
} 
  
class Main1 extends Product1 { 
  
    // this function computes
    // summation of 2 numb 
    public int sum1(int a1, int b1) 
    { 
        return a1 + b1; 
    } 
  
    // main function 
    public static void main1(String args[]) 
    { 
        Main ob1 = new Main(); 
        int p1 = ob1.product(05, 10); 
        int s1 = ob1.sum(05, 10); 
  
        // print multi
        System.out.println("multi is : " + p1); 
  
        // print summation 
        System.out.println("Sum is : " + s1); 
    } 
} 

Outcome:

Product: 50

Sum: 15

2,760 points
7 4