Examveda
Examveda

Choose the correct statement. Restriction on static methods are: I.   They can only call other static methods.
II.   They must only access static data.
III. They cannot refer this or super in any way.

A. Only (I)

B. (I) and (II)

C. (II) and (III)

D. Only (III)

E. (I), (II) and (III)

Answer: Option E


This Question Belongs to Java Program >> Declaration And Access Control

Join The Discussion

Comments ( 1 )

  1. Dipak Kumar
    Dipak Kumar :
    6 years ago

    public class Tester {

    int x =48;

    void display(){

    System.out.println(x);
    }

    public static void main (String[] args){

    Tester obj = new Tester();

    System.out.println(obj.x);

    obj.display();
    }

    }

Related Questions on Declaration and Access Control