Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Last week, we had the author of
TDD for a Shopping Website LiveProject
. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See
for the agenda and registration link
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
Beginning Java
Cannot find symbol t.playTape(); ?? Head first java problem
Joseph Abney
Greenhorn
Posts: 3
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Here is my code I am trying to make run but I am stuck. When I run it in terminal it says it cannot find symbol t.playTape();
class TapeDeck { boolean canRecord = false; void playerTape() { System.out.println("tape playing"); } void recordTape() { System.out.println("tape recording"); } } class TapeDeckTestDrive { public static void main(String[] args) { TapeDeck t = new TapeDeck(); t.canRecord = true; t.playTape(); if(t.canRecord == true) { t.recordTape(); } } }
Ulf Dittmer
Rancher
Posts: 43027
76
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Welcome to the Ranch.
Where do you reckon is the "playTape" method defined?
Charles D. Ward
Ranch Hand
Posts: 99
1
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Your TapeDeck class has 2 methods:
recordTape()
and
play
er
Tape()
So the compiler is right, you don't have a playTape() method.
Acetylsalicylic acid is aspirin. This could be handy too:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
compiler error
Cant compile GameLauncher.java
Why do i have to set the boolean value
page 42 exercice help
class and testclass
More...