46 Responses to “Java Video Tutorial 8”

First of all thanks alot for the awesome tutorial, probably the best one and you have my support. i completed upto this tutorial. i done exactly all the steps and i am getting the same output as of 20:45 but all the “-” and “|*|” are in next lines so i am not getting the same pattern.
Thanks
Sheron

There is no such thing as a stupid question. I created a multidimensional array named battleBoard. To get the length or size of the second part of the array I have to follow battleBoard with [0]. Does that make more sense?

1. In the LessonEight class I commented out the import org.apache.commons.lang3.ArrayUtils line because I don’t have it but the program runs fine without it. Have you actually used any of these utils yet? If so where? I’m not using an IDE just a text editor and a command line Window.

2. If one does use such a set of utils will the compiled program run in a standard environment ( without the apche stuff)?

3. Why does MonsterTwo class have a main function?

I like your videos but it takes time to fully digest some of them. Thanks!

Does everything from this.health = health; TO numOfMonsters++; fit under the first connstructor?

Reason I’m asking, is that I cannot for the life of me figure out why the grid is not printing properly. My grid keeps printing one long vertical of – then |*| with the |G| then the – again. I looked very carefully to compare your nested for loop to mine, but they both match exactly. hmmmmmrrrmmm :/

It is an array filled with MonsterTwo objects. Feel free to skip parts 8 and 10 of this tutorial series. I was experimenting with an idea, but I don’t like how it came out. I’m very happy with the rest of the tutorial though.

Congrats you have now replaced the kind lady from India (Prop. Calc. videos) as my favorite internet personality. Just playing around with your code a bit, and I added the ability when using the default constructor MonsterTwo() to display the first letter of the name on the board. As is (at least in the video) this don’t be a happening. But a little of “The joy of Cut and Paste,” and BAM!! Show me the ‘B’ 🙂 Anyway thank you for the time and effort. I have been using my old textbook for a review, and as a guide in my plan to help my brother (he has 1301 in fall), and this is 10^(you pick) times better! I plan on watching all your videos over the next 90 days…It’s Java Boot Camp!!! …An array of objects? Who wouldn’t get fired up!!!

You normally get that error if you don’t save your file in the src folder. I made a tutorial to help with many of the other common Eclipse errors that may help called Install Eclipse for Java. I hope that helps

in the file lessonEight.java , you have defined a class lessonEight and you written a code ” MonsterTwo.buildBattleBoard();

where MonsterTwo is a object according to you. but how can the object have the same name as of its class. i mean to we should have defined an object like
MonsterTwo xyz = new Monstertwo();
and then called the function
xyz.buildBattleBoard();

I am having difficulty in understand how MonsterTwo.buildBattleboard(); works.
To my understanding, MonsterTwo is the blueprint for new MonsterTwo objects to be created. Once new MonsterTwo objects are created, then we can perform different operations on the new object. But when we write MonsterTwo.buildBattleboard(); before creating a new object, where is the computer performing this action? There is no object to work with. I am a newbie and this may be a very silly question. But if you please take some time to explain a bit, it would be helpful. I hope my query is clear to you.. 🙂

The best thing to do is to skip parts 8 and 10. I was trying to teach a topic that was to advanced using the limited amount of Java I had taught at that point. The rest of the tutorial is good though in my opinion. To improve I have to on occasion experiment with new ideas and parts 8 and 10 were failed experiments in my opinion.

I’ve imported the apache lang3 files as you showed in your video but my Eclipse still doesn’t recognize them for some reason. At the top where you import libraries it says that the import org.apache cannot be resolved and when I try to run it anyways I get this message:

I’ve tried copying the commons-lang3-3.3.2.jar and commons-lan3.3.3.2.jar files (those are the ones I could find on their site, they should be the latest version) to the src folder. That didn’t help either.

Well hello Derek!
I have been following your java tutorial series heretofore and everything has been going on well. I must say, you happen to be the best java tutor I have followed so far… way2go Derek!
But it seems now I am having issues fixing this error I am getting after trying to run LessonEight.java. It says something funny like, “IOConsole Updater – An internal error has occurred.” When I click the ‘Details’ button I get “No more handles.” May you please help me troubleshoot this?

Great tutorials Derek, thanks so much. Just to be clear on the x and y positions, typically when we draw a graph, x is the horizontal axis and y is the vertical access but I guess when we’re dealing with the battleBoard here as constructed, x is analogous to i, which actually is the rows of the char[][] and Y is the columns. So in other words, on the battleBoard, x actually is the vertical axis and Y is the horizontal. correct?

First off tnx a bunch for your excellent tutorials. I have a question regarding the difference between the JRE System Library versions. I tried running it with JavaSE-1.8 and it didn’t work, After some foolin around I tried changing the JRE System Libarary to version 1.6 and it miraculously worked! Any idea as to why it doesn’t work with 1.8?

Hi Yusuf, I did that because building the battle bored isn’t something a monster would be able to do. It is a utility method. Feel free to skip parts 8 and 10 of this tutorial series. I cover this information much better later in the tutorial.