Monday, 2 April 2018

interfaces in java (Abstraction in OOP)







package javaapplication25;





interface shape

{



    void area();

 

}

class square implements shape

{

float s;

 public void area()

 {

     System.out.println("area of square is "+s*s);

 }





}



public class JavaApplication25 {



   

    public static void main(String[] args)

    {

       square s= new square();

        s.s=10;

       s.area();

   

       

    }

   

}


No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...