tag:blogger.com,1999:blog-7258332205026269340.post3291886062757825293..comments2024-02-21T01:43:44.367-08:00Comments on Selenium-By-Arun: 73. How does a method intake parameters ?Priyanka Motoorihttp://www.blogger.com/profile/04643338373711611455noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-7258332205026269340.post-13300258282736892742016-01-28T12:52:20.943-08:002016-01-28T12:52:20.943-08:00Thanks Arun for this wonderful blog!! :)
I am rea...Thanks Arun for this wonderful blog!! :)<br /><br />I am really glad to find such a informative Blog.<br /><br />I am a manual tester and only and only trying to learn selenium from ur blog and it is really helping me a lot :)<br />Thanks again...<br /><br />@Ragavi as per the comment mentioned by Arun i have modified your code as below:Plz try it out<br /><br />public double dimension(double w, Anonymoushttps://www.blogger.com/profile/10180642348865091631noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-66709708769582103282015-04-02T04:54:51.856-07:002015-04-02T04:54:51.856-07:00@ Raghavi - (reply for first comment) We can use b...@ Raghavi - (reply for first comment) We can use both ways based upon our requirement. Req#1 -> If your requirement is not to return any values to the calling method, you can directly print the value of volume in the called method.<br />Req#2 -> If your requirement is to use one method to set the dimensions of a box and have few other methods to calculate Volume and Area of the box. Then weArun Motoorihttps://www.blogger.com/profile/18156045285817519369noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-61203705663117362222015-03-18T12:09:52.729-07:002015-03-18T12:09:52.729-07:00Raghavi:
Remove the S.O.P in the below code and ...Raghavi: <br /><br />Remove the S.O.P in the below code and it will work.<br /><br />Your Code:<br />System.out.println(box1.dimension(5, 7, 8));<br />System.out.println(box2.dimension(2, 9, 9));<br /><br />Make it as:<br />box1.dimension(5, 7, 8);<br />box2.dimension(2, 9, 9);Ranjith Kumarhttps://www.blogger.com/profile/06736025304072546450noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-12208912283623279452014-09-03T02:18:58.751-07:002014-09-03T02:18:58.751-07:00package second_package;
public class Box {
d...package second_package;<br /><br />public class Box {<br /> <br /> double width;<br /> double height;<br /> double depth;<br /> <br /> public void dimension(double w, double h, double d)<br /> {<br /> width = w;<br /> height = h;<br /> depth = d;<br /> System.out.println(w*h*d); <br /> }<br /> //public double volume()<br /> //{<br /> //return width*height*depth; <brraghavihttps://www.blogger.com/profile/01650096213661941256noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-92205325664996300842014-09-03T01:58:49.218-07:002014-09-03T01:58:49.218-07:00Hi arun
i have a question
in void method u assign...Hi arun<br /><br />i have a question<br />in void method u assigned variables<br />width=w;<br />height=h;<br />depth=d;<br />instead of using double method<br /> can we give like this? of course it wont return the value <br /><br />System.out.println("volume is "+width*height*depth);<br /><br />are we supposed to use this?<br /><br /><br />raghavihttps://www.blogger.com/profile/01650096213661941256noreply@blogger.com