Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Static import

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code is from K&Bb of Chapter 10 question 4 with the names modified.


When i run the code with

java HelloWorld _ - A
I get the result " -A"
The answer mentioned is "A"

Can some one point where I am going wrong...
[ July 08, 2008: Message edited by: Nabila Mohammad ]
 
Matt Russell
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like it's just a mistake in K&B. It's not in the errata, though, although a typo on the same question is.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some body please confirm that..
A mistake on a question hardly seems the kind of thing that will go unnoticed..
 
Irina Goble
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nabila Mohammad:
java HelloWorld _ - A
[ July 08, 2008: Message edited by: Nabila Mohammad ][/QB]


The underscore is the name of the class in the question, so if you call your class HelloWorld, you should not type the '_' in the commad line.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohh Thanks... Irina

Silly ME!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic