Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static members

 
Waez Ali
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying something which is not working.

Class A{



}
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that all the code? Remember that Java is case-sensitive.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
empty class should compiler.

calss a{}
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yeah Java compiler compile this empty class but it cannot compile with this syntax..

Originally posted by Rahul Bhattacharjee:

calss a{}



 
Ravindranath Chowdary
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every class in java which is syntactically correct compiles fine.

Your code:
class A{
}
compiles fine. I think the mistake you did is, you have written C as capital letter in the keyword class.

Thanks,
Ravindranath
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic