Re: Best Java Guides for a Newby?

  • From: David Tseng <davidct1209@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Sat, 30 Jul 2011 18:16:50 -0700

Also, forgot to add, you don't need an interface if you don't want.
In fact, I'd suggest you stay away from them for the time being as you
learn.  Again, probably best to work out the holes in your knowledge
before venturing on writing your own examples.


On 7/30/11, David Tseng <davidct1209@xxxxxxxxx> wrote:
> I'll take a shot at answering your questions:
>
> On 7/30/11, Brandon Keith (Biggs) <brandonboy13@xxxxxxxxxxx> wrote:
>> Hello,
>> I finally had time to go past the HelloWorldApp in the tutorial. :D
>> Now I'm trying to create my own classes then run them through my
>> interface...
>> But I'm a little confused:
>>
>> The HelloWorldApp had everything in it. It didn't need a interface, why
>> do
>> we need to make a separate interface for all our other classes?
>>
>
> Not clear on the wording of the question.  In general, you write an
> interface for the purposes of inheritance and polymorphism.  In other
> words, it acts as a "blueprint" for other classes' implementation.
>
>> Why do we have to create an interface when the class already has the same
>> code in it?
>>
>
> This has to do with good object oriented design.  I'll get to
> specifics in your example below.
>
>> Do you save all classes as a .java file then use javac to compile it into
>> a
>> .class file?
>>
> Yes.
>
>> What do you save interfaces as?
>>
>
> The javac tool reads class and interface definitions and compiles them
> into bytecode class files.
>
>> I created a class for my heater:
>>
>> /** creates the class for heater which has temperature, speed and onOff
>> */
>> class Heater }
>>
> Syntax error "}"; should be "{"
>
>> int temperature = 0
>> int speed = 0
>> int turned = on
>>
>> voide changeTemprature(int newValue) {
>> temperature = newValue;
>> }
>>
>> voide speedUp(int increment) {
>> Speed = speed + increment;
>> }
>>
>> voide slowDown(int decrement) {
>> Speed = speed - decrement;
>> }
>>
>> voide turnOn() {
>> Turned = on;
>> }
>>
>> voide turnOff() {
>> Turned = off;
>> }
>>
>> voide printStates() }
>> System.out.println("temprature:"+temprature+" speed:"+speed+"
>> turned:"+turned);
>> }
>> }
>>
>> Where do I put the lines like:
>> public static void main(String[] args)
>
> You can include this in any class.  In your case, this Heater class
> would do as good as any.
>
>> and
>> System.out.println
>> ?
>
> This method allows you to print a message to the console.  It's up to
> you where you'd want output printed.
>
>> Also do I have the right idea with the word after void is the word I type
>> to
>> turnOn the heater?
>> And the word after (int is the word that could be what ever I want it to
>> be,
>> it just needs to be the same below?)
>> Example:
>>
>> voide slowDown(int pizza) {
>> Speed = speed - pizza;
>> }
>> ?
>
> Not sure how the book you're reading introduces java constructs, but
> you should perhaps read about methods.  Is this class something you
> got from the book?  I'm not understanding your question, but sounds
> like you're wondering what each of the parts of a class method
> definition means:
>  voide slowDown(int pizza) {
> void is the return type
> slowDown is the method name
> int is a primitive type.
> pizza is the name of the int.
>
> If you don't know what the above terms mean, you should dig through
> the book you're using.  Any decent language programming book will
> introduce these things in the first few chapters if not the first.>
>
>> If you have any question, the interface for the heater is:
>>
>> interface Heater }
>>
>> voide changeTemprature(int newValue);
>>
>> voide speedUp(int increment);
>>
>> voide slowDown(int decrement);
>>
>> voide turnOn();
>>
>> voide turnOff();
>> }
>>
>
> You'll want your Heater class to inherit from this class and you need
> to name them differently.  "IHeater" and "Heater" for example.
>
> I'd suggest working through the book cover to cover instead of
> creating your own examples.
>
>> Sorry, I didn't see answers to these questions in the tutorials and I
>> need
>> to know this to do anything!
>> Thank you,
>>
>> Brandon Keith Biggs
>>
>> Check out
>> MySpace: http://www.myspace.com/brandonkeithbiggs
>> Also add me on facebook!
>> brandonkeith
>> http://www.facebook.com/profile.php?id=675097942
>> And for my resume go to:
>> http://www.sfcasting.com/brandonkeith
>>
>>
>> From: Sina Bahram
>> Sent: Thursday, July 07, 2011 6:50 AM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: RE: Best Java Guides for a Newby?
>>
>>
>> That's not learning a language Ken, that's learning an SDK, which implies
>> one already knows how to use the language.
>>
>>
>>
>> I think you should start off with text as well, so that six months later
>> you
>> aren't asking basic questions like why doesn't this class run, because
>> you
>> never had to put a mian method in it since Eclipse always did that for
>> you,
>> etc. etc.
>>
>>
>>
>> Of course, that implies that you actually want to learn the fundamentals
>> of
>> the language, and not just code.
>>
>>
>>
>> Take care,
>>
>> Sina
>>
>>
>>
>> From: programmingblind-bounce@xxxxxxxxxxxxx
>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Ken Perry
>> Sent: Thursday, July 07, 2011 7:17 AM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: RE: Best Java Guides for a Newby?
>>
>>
>>
>> I have to disagree with this.  There is nothing like using eclipse when
>> you're learning a language.  Let's say you are in Android and need to
>> make
>> an Application.  Ok so you start it up and there is an Activity class.
>> You're in your text editor what do you do?
>>
>>
>>
>> You go out on line or into a document and try to read up on all the
>> possible
>> functions you can run in an activity.   Not bad but why not make it
>> quicker.
>>
>>
>>
>> Just arrow to your myactivity and use the source menu and go down and
>> select
>> override members.  Then you can arrow through the list of things you have
>> that you can do in that class.  You check a few and tab down and hit ok.
>> Now you have 6 stub functions that work perfect.  You then go down to the
>> keydown function that you just added  and arrow over keyEvent and select
>> help it tells you all the functions
>>
>>
>>
>> Eclipse and Visual studio are  not just environments but they are  great
>> learning tools.  Not to mention learning the environment now with an easy
>> program will  speed up both development of a harder program but it also
>> teaches you how to download other peoples projects and get them running.
>>
>>
>>
>> Heck for that matter if you don't use eclipse you have to learn another
>> way
>> to compile your project.  Which normally means you start compiling at the
>> command line with javac.  That sounds easy but how many of you have tried
>> this and ran into the java path problems.  That is not something you want
>> to
>> get a new user into right away.  Then if you want to get real bold and
>> use
>> ant as a new programmer you better have a lot of antacid.
>>
>>
>>
>> So I guess in short I just wanted to say sure Eclipse is a big pig but
>> the
>> gains for a new coder is pretty high if you learn to use it.  Now if
>> you're
>> on a Mac sorry to hear it while I like Mac I have not been impressed with
>> the amount of work I had to go through to get Eclipse set up.  I use it
>> on
>> both Mac and Windows but I will tell you there is nothing like Eclipse
>> and
>> Jaws 12.  I use no scripts and do just fine.
>>
>>
>>
>> Ken
>>
>>
>>
>> From: programmingblind-bounce@xxxxxxxxxxxxx
>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Homme, James
>> Sent: Thursday, July 07, 2011 6:49 AM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: RE: Best Java Guides for a Newby?
>>
>>
>>
>> Hi Brandon,
>>
>> This is my opinion, so take with a grain of salt. Right at the beginning
>> with Java, I feel that you should use a text editor. Personally, I prefer
>> EdSharp, but there  are lots of good ones. Learn to use the command line
>> tools that come with the Java Development Kit. After you have written
>> some
>> programs, and you know what's going on with basic Java, start to use
>> something like Eclipse or Net Beans. I have no experience with SodBeans,
>> but
>> I understand that that package for NetBeans is making a big difference in
>> NetBeans accessibility. So scrap fancy editors for now.
>>
>>
>>
>> Jim
>>
>>
>>
>> From: programmingblind-bounce@xxxxxxxxxxxxx
>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Brandon Keith
>> (Biggs)
>> Sent: Thursday, July 07, 2011 12:17 AM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: Re: Best Java Guides for a Newby?
>>
>>
>>
>> Thanks and I started reading those, the only problem is I use Eclipse and
>> these talk about the Netbeans IDE which I think it is inaccessible.
>>
>> My big question is: What are all the differences in the different things
>> you
>> can create with the new menu in Eclipse? There are like projects,
>> classes,
>> Java projects and all kinds of other things that aren't really talked
>> about
>> with Java.
>>
>> Thanks,
>>
>>
>>
>> Brandon Keith Biggs
>>
>>
>>
>> Check out
>> MySpace: http://www.myspace.com/brandonkeithbiggs
>> Also add me on facebook!
>> brandonkeith
>> http://www.facebook.com/profile.php?id=675097942
>> And for my resume go to:
>> http://www.sfcasting.com/brandonkeith
>>
>>
>>
>> From: Homme, James
>>
>> Sent: Wednesday, July 06, 2011 9:36 AM
>>
>> To: programmingblind@xxxxxxxxxxxxx
>>
>> Subject: RE: Best Java Guides for a Newby?
>>
>>
>>
>> Hi,
>>
>> I think that, as with many things, this is one of those things that can
>> be
>> different, depending on the learning style and knowledge of the person.
>>
>>
>>
>> Speaking just for myself, I get more out of tutorial style books, when
>> I'm
>> learning a language. I tend to freeze up at reference type material that
>> is
>> full of code and short on words, but that's my taste.
>>
>>
>>
>> According to me, you will probably do well with the nutshell books, if
>> you
>> already know lots of programming concepts and want to see how certain
>> things
>> are done in Java. On the other hand, you may do better if you have little
>> programming experience by looking at the Java Tutorial, which takes things
>> a
>> concept at a time and explains them with lots of words and examples. You
>> can
>> see that at
>> http://download.oracle.com/javase/tutorial/reallybigindex.html.
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Jim
>>
>>
>>
>> From: programmingblind-bounce@xxxxxxxxxxxxx
>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of qubit
>> Sent: Wednesday, July 06, 2011 12:30 PM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: Re: Best Java Guides for a Newby?
>>
>>
>>
>> I would recommend if you have a subscription to bookshare.org, that you
>> download a copy of "Java in a Nutshell".  It is a nice summary of
>> features
>> with some examples.  I was going to read "Thinking in Java, 4th edition",
>> which I forked $25 for online, but got a package that I cann't display on
>> my
>> system.  I have been unable to read more than the preface, and most the
>> time, the html just freezes things.  So I'm pitching it.  A shame as it
>> sounds like a useful guide to using java the way it is meant to be used.
>>
>>
>>
>> Online there are also common tasks implemented in java, which you can
>> find
>> in http://commons.apache.org/
>>
>> Good luck and happy hacking.
>>
>> --le
>>
>>
>>
>>   ----- Original Message -----
>>
>>   From: Florian Beijers
>>
>>   To: programmingblind@xxxxxxxxxxxxx
>>
>>   Sent: Wednesday, July 06, 2011 6:44 AM
>>
>>   Subject: Re: Best Java Guides for a Newby?
>>
>>
>>
>>   Hello Brandon,
>>
>>
>>
>>   Do you have any form of IM or perhaps skype? I would like to help you
>> but
>> it's easier for me to recommend something if i know a bit more about your
>> background.
>>
>>
>>
>>   Florian
>>
>>   On Jul 6, 2011, at 8:04 AM, Brandon Keith (Biggs) wrote:
>>
>>
>>
>>   Hello,
>>
>>   I'm new to programming, (I have just made it past "Hello World") and am
>> looking for some guides.
>>
>>   I would like to learn Java, but I'm not quite sure where to start. I
>> downloaded the 500 or so documents from the "Java Documentation" at:
>>
>>   http://www.nonvisualdevelopment.org/node/20
>>
>>   as well as reading all the tutorials on Eclipse and Java.
>>
>>   I've installed the SDK 1.6 and Eclipse, is there anything else I need?
>> I
>> see there are Jaws scripts for Eclipse, where do I insert those?
>>
>>   I arrowed through the 500 documents dealing with Java and found:
>>
>>   Java Tutorial 3rd Edition, a short course on the basics
>>
>>   but I see it was written in 2001 and only deals with Java 1.3 and
>> Windows
>> 2000 and before. Is this something I should read? What books best
>> describe
>> the language in an exciting and useful format? I'm wanting to eventually
>> program for Android, but I think that is stepping a little ahead of
>> myself.
>>
>>   Where do I start?
>>
>>   Thanks,
>>
>>
>>
>>   Brandon Keith Biggs
>>
>>
>>
>>   Check out
>>   MySpace: http://www.myspace.com/brandonkeithbiggs
>>   Also add me on facebook!
>>   brandonkeith
>>   http://www.facebook.com/profile.php?id=675097942
>>   And for my resume go to:
>>   http://www.sfcasting.com/brandonkeith
>>
>>
>>
>>
>>
>>
>> --------------------------------------------------------------------------------
>>
>> This e-mail and any attachments to it are confidential and are intended
>> solely for use of the individual or entity to whom they are addressed. If
>> you have received this e-mail in error, please notify the sender
>> immediately
>> and then delete it. If you are not the intended recipient, you must not
>> keep, use, disclose, copy or distribute this e-mail without the author's
>> prior permission. The views expressed in this e-mail message do not
>> necessarily represent the views of Highmark Inc., its subsidiaries, or
>> affiliates.
>>
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: