Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package method;
- public class Method {
- public static void main(String[] args) {
- Rectangle obj = new Rectangle();
- obj.test(10,5,2);
- obj.test(10, 5);
- obj.test();
- }
- }
- class Rectangle{
- double width;
- double length;
- double height;
- void test(double length, double width, double height){
- System.out.println(height*length*width);
- }
- void test(double length, double width){
- System.out.println(length*width);
- }
- void test(){
- System.out.println("Hello Fozle!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement