search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
1 vote
1.2k views
which of the following can not be declared static ?

a)class   b)object    c)functions    d)member variables
in Object Oriented Programming 1.2k views

2 Answers

1 vote
A. Class

In Java, only nested classes can be declared static.
0
and object ?
0
public static void main it is declared for class...I think object will be the answer
0

@Meenakshi Sharma Yes, an object can be static.
@Pavan Kumar Munnam That declaration is of main method, not class.

0 votes

Answer: (A)

In fact, all of them can be declared static but a top-level class cannot be made static.

A good read: https://stackoverflow.com/questions/7486012/static-classes-in-java

Related questions

2 votes
1 answer
2
500 views
let x be an array of integer . which of the following can not be present in the left hand side of an assignment statement a)x b) x+i c) * (x+i) d) &x[i]
asked Feb 18, 2017 in Programming Sanjay Sharma 500 views
0 votes
1 answer
3
270 views asked May 14, 2017 in Operating System Ramya balakmar 270 views
1 vote
2 answers
4
194 views
In C, An array is declared as int a[5]; What will be the result if i execute this statement a[5] = 0; A. Segmentation fault B. All elements will be initialized to 0. C. A 0 will be stored outside array boundary D. C does boundary check and a compiler error will be displayed
asked Nov 5, 2016 in Programming sh!va 194 views
...