This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data types

 
kevinn lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

how can I make this compile without making changes in method printB?
thanks
 
Mikey Schmidt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cast the int to a byte while calling the printB method
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cast the int parameter to byte.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys, let's let him do his own homework next time: please see DoYourOwnHomework and NotACodeMill.

Instead, provide hints, like "What type does the method expect?" and "What type is an uncast numeric literal?" with links to the relevant documentation does (at least) two things: highlights what the problem is (without giving an answer) and stimulates the Java thought process--and that's what we're all about.

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic