File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

should we include {

 
Roll
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which are valid declarations :
a. private class A
b. class X extends class Y { // Note the {
both a & b are valid. so when they mention class declaration should we include { ?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would have to say that neither one is a valid declaration - but both can be part of a valid declaration. A valid class declaration would have to include { and }, unless something in the problem wording suggests that the declaration doesn't have to be complete. I have seen sample questions that ask "which can be part of a valid declaration?" - both (a) and (b) would then be valid.
 
maha anna
Ranch Hand
Posts: 1467
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Jim. the 2nd declaration
class X extends class Y {
is not valid even as 'part of a valid declaration. It has 'extends class Y' . It shd be 'class X extends Y'
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops. You're right of course. I was only thinking about the {, silly me. Thanks.
 
Cherry Mathew
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if u guys r talking about what to write in JCP exam what if they ask to write a method and what if that method take parameters
and what if the ask us to replace a statement do we have to put the semicolon also
Cherry
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic