- #Blue pelican java textbook lesson 10 project how to
- #Blue pelican java textbook lesson 10 project code
#Blue pelican java textbook lesson 10 project code
I just resorted back to the book's code, because I have changed my code so much after one week that I can't even follow it myself or know what changes I made or what the original error was! I do know that I stripped both down to just the bare basics. I just want to tear hear hair out!! Can anyone explain to me the line "Circle.cir1=new Circle(35.5) "? The only thing in my code that was not in the book's code is the diameter method. I can't believe that I've been working on THIS DAMN THING FOR Almost A WEEK AND I just got it to work using the books stupid code after one try. Public double radius //This is a State Variable…also called Instance Public double circumference( ) //circumference method It performs some action (in this case it calculates the This part is called the constructor and lets us specify the radius of a This is the code we're given from the book to work with: Then I search the Internet, wasting valuable time and end up drowning in too much information that sometimes seems conflicting and usually is not defined so I end up more confused.
#Blue pelican java textbook lesson 10 project how to
I know the mistakes I tend to make so that makes my stupid little mistakes easier to find, but when I'm using the syntax wrong, I have no clue how to fix it. In my class we are also not supposed to use any program that compiles for us, so we have to compile each program after we've completed it, then figure out what the error messages are referring to. I am trying to create mine in two different classes. I can get mine to work if I declare-don't know if that's the correct terminology-something being passed to the method, but we're not supposed to do that. What I can't figure out is how do I get this thing to work without passing something to the method? ( cir1.diameter( ) ) // should give 71.0 as the answer. it's obviously not like this in the book and I couldn't figure out what exactly it was referring to had to bracket these in code because the Ranch didn't like my abbreviations (Your project should have two classes, Tester and Circle.) In a Tester class, test the performance of your new diameter method as follows: It should return a double that is the diameter of the circle. Add this method to the Circle classĭescribed on page 15-1.
![blue pelican java textbook lesson 10 project blue pelican java textbook lesson 10 project](https://www.coursehero.com/thumb/68/11/68112572787a4de959833d056e7ad5ae1a8737db_180.jpg)
In the Blue Pelican Book the exact instructions (on page 15-4) are:Ĭreate a new method for the Circle class called diameter. Do you have any recommendation of a beginning Java instruction book that might be able to explain some of this in simple English?
![blue pelican java textbook lesson 10 project blue pelican java textbook lesson 10 project](https://i1.rgstatic.net/publication/317106439_We_need_to_talk_about_this_third_edition_about_the_new_eugenics/links/5f018e67a6fdcc4ca44e6f4b/largepreview.png)
I have programming experience in Visual Basic 16 years ago and an even older language that I'd rather not say Pascal for fear that it might reveal my age, and HTML if you call that programming, but I cannot find any straight forward Java instruction beyond oracle and which are great, very easy to understand but don't go much beyond the simplified examples. It uses programming examples but sometimes doesn't even define what the syntax is or what each piece of the example program is doing, so I'm left to figure it out on my own or try to find better explanations on the Internet and I end up drowning in information.Īlso in my class we are jumping around quite a bit, so it makes me feel like I'm missing a lot of the basic basic foundation. In my class, we have a different book "Introduction to Programming in Java" in addition to the Blue Pelican above that doesn't seem to have much better explanations. Before I get to that:Ĭan you explain the above quote to me, particularly "inner class instances require an instance of outer class to exist.and static content does not have an outer class instance"? I'm not sure I completely understand that. ), but slightly different problems that I'm running into. I have the same problem from the same stupid book (I use the one located at I think James and I might be in the same class. The main method is in the outer class class, but it is a static method - and static content does not have an outer class instance (via the this reference).
![blue pelican java textbook lesson 10 project blue pelican java textbook lesson 10 project](https://rochester.kidsoutandabout.com/sites/default/files/styles/activity_image/public/imageedit_7_5936722028.gif)
Henry Wong wrote: And inner class instances require an instance of the outer class to exist. take out the word public from the Circle class. take the public class Circle and place it in its own file. Okay i got my code to run in two ways, 1. I am working out of blue pelican book and the instructions are to use a public variable so it is available to all the methods in one single class.