Java Abstract keyword
Submissions: 837   Accuracy:


  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

abstract is a non-access modifier in java applicable for classes, methods but not variables. It is used to achieve abstraction which is one of the pillar of Object Oriented Programming(OOP). Following is an example of abstract class.

abstract class A 
    int prod;
    abstract void m1(int p,int q);
    void m2()

As we know , we can't create an instance of an abstract class. Hence create and another class that extends the abstract class , then you can create an instance of the new class.

Also m1 method is abstract too, that means you must implement the body of that method in the child class.

Main function is already created in the editor and instance of class B is also created . So your task is to write just class B . 

First line of input file contains an integer T, denoting the number of test cases. Then T test case follow. First and only line of each test case contains two integers a1 and a2.

For each test case, print output as the product of the two nos. a1 and a2.


9 2
8 4



** For More Input/Output Examples Use 'Expected Output' option **

Contributor: S_A
Author: saksham0751

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use, generate link and share the link here.

to report an issue on this page.