This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class declaration

 
antraarora
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody help me with this one.
Which variables should you use to declare the class Hexagon. Hexagon is drawable and it has several vertices, Colors that can be stored by a Vector and a flag of boolean type. What can you use to declare the member variables of this class?
A. Object
B. boolean
C. Vertice
D. Vector
E. Hexagon
Since none of the modifiers are given...do we assume that we have to specify the modifier(public) as a part of declaration?
Should it be
public class Hexagon extends drawable(vertice integer, flag boolean, color vector){}
Now, 1. I have used a lot of words not given. Is that right?
2. What is the correct answer?
3. Should {} be used while decalaring a class?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic