Sunday, 18 December 2022

Develop a program To display student data by using interface 1) Name 2) Roll no



INTERFACE: 






interface Student  
{
    public void data();
   
}
class avi implements Student
{
    public void data ()
    {
        String name="avinash";
        int rollno=68;
        System.out.println(name);
        System.out.println(rollno);
    }
}
public class inter_face
{
    public static void main (String args [])
    {
        avi h= new avi();
        h.data();
    }
}







OUTPUT:
 avinash
68



No comments:

Post a Comment

GitHub Most Imp Command For Every Developer Learn:

 Top Command for GitHub:  1) git clone 2) git init and git status   3) git add file name  or git add .  4) git commit -m message  5) git rem...