Win a copy of Securing DevOps this week in the Security forum!

James Sands

Greenhorn
+ Follow
since Aug 10, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by James Sands

Hi people, well Junilu - your wish is my command. I have had a go. Good news, compiles and runs - Bad news I think it's a little messy. Especially with the way I create the player object into the arraystore class and then having to "double reference" my objects in main (e.g as.p.playerguess). Any thoughts or concepts I am missing to tidy up even further?

Thanks again, James.

5 years ago
Where a little help gets you on CodeRanch!:



Thanks, without those little hints I wouldn't have got this far!
5 years ago
Loving that - learning now learning!!

I see a stringbuilder replace method maybe better for me, I'll do some alterations and tell you how I get on!

Million thanks! James.
5 years ago
Hi, me again! - I just thought you could have a look through this - I like the whole "dont tell me the answer but learn" philosophy, so point me in the right direction.

My desired output to this compiling code is "p----", but as you can see I am frustratingly still getting "panda".

I think I'm not interpreting the String replace API correctly, but as I'm now getting frustrated - I will ask for a hand! Thank you!

5 years ago
Nope, nothing - I've checked the book, nothing in there relating to a BeatBox2

UPDATE: Nope you're right - there is errata for this page. Which means I should have read this first! Thank you!

it's -

Sorry
5 years ago
No, hence my original confusion. There is no BeatBox2 class.
5 years ago
I think I've done some editing whilst you replied, but that is great. Thank you for your help.
5 years ago
Thanks Campbell - I think I'm with you on the concept, but to fully understand, if I built in.



would this work/compile?
5 years ago
Me again,

This does complie but I do not understand exactly why, there seems to be no object instantiation unless I am missing the point of 'new'. Is it because the main is a nested class within BeatBox?

If you need more code let me know - but I cannor find another line of code with BeatBox2

Thanks, James.

p.s I know I have left all of the import stuff off




5 years ago
Well - I'm definately coming back - even Arunkumar's short but very sweet comment regarding inheritance prompted me to click on Tree in the Java API and it all made sense. Thank you for sticking with me, you've been a great help!

Greenhotrn Jim.
5 years ago
So I've got the basic concept then?!?

p.s The Olympics are AMAZING! - I don't want them to end!
5 years ago
Stay with me - Junilu you're right - I see I have opened a Pandora's box when I ran that code!!

Ok - I'm looking at this in a real world layman situation - I want to get into music, so I buy a sequencer and I want it to play/process Midi Files. However - One day I get curious HOW my sequencer plays Midi Files so I decide to take my Sequencer apart. I then can't put it back together, and the cat is dead.

As long as I know I CAN do it, I dont need to KNOW.

What do you think? (You're gonna love me!)
5 years ago
If I wanted to be curious, could I find this class you mention? Thanks so far....
5 years ago
Sorry, not quite. I think it's to do with implementation from another class but I'm being slow to the punch.
5 years ago
Howdy partners, hope you can help - I'm trying to understand the below line. It appears by looking at java.sound.midi.* - we are creating an object Interface instance, with a class and a method from another part of the package.

Here it is -



How do we instantiate an object from an Interface, and how does the above all relate. Thank you for your help!
5 years ago