Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

How can I call java functions in sahi script using object

monika786monika786 Members
edited March 2013 in Sahi Pro
I have created a java class containing non static function.This class does not contain main() method.And now I have to call java function using object in sahi script.How can I do it?
Program:
package com.Begin;

class Inher {
int length;
int breadth;
public void In(int x,int y)
{
length=x;
breadth=y;
}
public int area()
{
return(length*breadth);
}
}
public class DrawingRoom extends Inher{
int height;
public void Room(int x,int y,int z)
{
In(x,y);
height=z;
}
public int volume()
{
return(length*breadth*height);
}
}


script:
var $dr=new Packages.com.Begin.DrawingRoom();
dr.Room(3,4,5);
var $kk=dr.volume();
_alert($kk);
Sign In or Register to comment.