adplus-dvertising
frame-decoration

Question

Which of the following is a valid class declaration?

a.

class A { int x; };

b.

class B { }

c.

public class A { }

d.

object A { int x; };

Answer: (a).class A { int x; };

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following is a valid class declaration?