Menu
Topics Index
...
`

Static method


If you need explanation Read this topic

If you need Answer Take test on this topic

Static method
What will be the output of the following program?
public class Null {
    public static boolean greet() {
        System.out.print("Program execute = ");
        return true;
    }
    public static void main(String[] args) {
        System.out.println(Null.greet());
    }
}

A. Program execute = true
B. Program execute = false
C. Program execute = null
D. Program execute =
E. Some other output
F. Compilation Error or Runtime Error
Topic: Creating Static Methods In Java Using Static Keyword

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

answer is A

Posted by Shiva Goud    2013-12-06 03:38:06


Ans is A. by calling Nul method it prints Program execute= and returns true..

Posted by Om Prakash Om    2013-12-06 03:47:39


A is the answer..we r calling the greet method and it is printing and then returning true..

Posted by Kiran Karrolla    2013-12-06 04:12:08


Congratulations Kpyn Kiran. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2013-12-09 03:19:28


© meritcampus 2019

All Rights Reserved.

Open In App