|
-
October 18th, 2011, 11:51 AM
#1
Problem with understanding basic Java.
Hi all.
I recently started a degree in computing science, and one of my modules is in Java.
I understand very basically the framework of how the program operates, but i'm stuck on things like the layout of the code and what each part is actually doing and how they all link together.
Eg, i'm stuck as to how the program files are stored, to then access the class. I also don't really understand the basics of what you can and CAN'T do within your code. I've been doing lots of reading about it but nothing seems to be sticking. Is there any resource on the web where code has been illustrated to tell you what it does, how it works (eg, this is the class, this is the method, this won't work without that) and stuff? I pretty much need a from the ground up approach to saying what will work on its own, what parts rely on other things like definitions or variables and the like.
I've searched but to no avail!
I'm new here too, so hi.
-
October 18th, 2011, 03:15 PM
#2
Re: Problem with understanding basic Java.
 Originally Posted by swiftpunch
I've searched but to no avail!
There's a vast amount of stuff out there. If you can't find what you want, it must be pretty esoteric - but it's hard to know quite what you want to know when you're that vague.
This isn't a Google front end, but the first place to look is the Java Tutorials.
If that doesn't cover it you'll have to be more specific.
They know enough who know how to learn...
J. Adams
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
October 18th, 2011, 07:48 PM
#3
Re: Problem with understanding basic Java.
well lets start at the very bottom current running through the board is interperted as either a 1 or a 0, then using this logic it stores what it wants, on a some memory device (there's several ways to do such a thing). Now the JNI (I myself am a little fuzzy on the exact names so it might be the JVM that I'm talking about, but for now try not to get caught up in the termonology) interpretes these 1's, and 0's as certain things for example:
Code:
0011001 = G
0011111 = K
etc..
Using this it can have the current flow a specific way using the memory chip if you put
00111110011001 perhaps it will run to the monitor, and display KG
This is the very specific code (your compiled code that looks like gibberish) this is directly comunicating with the circut board. Now they created for you API's which are made so you can use this language without having to learn such specific codes. They also use things like ASCII to interchange with different hardware/code.
I don't know if this is what you were looking for, but if not maybe it will help anyway.
Post Script:
This (http://en.wikipedia.org/wiki/Printed_circuit_board) should start you off on a search for exactly how those electrons cause these things to react.
-
October 19th, 2011, 01:07 AM
#4
Re: Problem with understanding basic Java.
 Originally Posted by swiftpunch
I pretty much need a from the ground up approach to saying what will work on its own, what parts rely on other things like definitions or variables and the like.
I suggest you get one of these "dummies" books, like Java for Dummies or Sams Java in 24 hours or something. I interpret "dummies" as meaning they start at a very basic level.
-
October 19th, 2011, 08:03 AM
#5
Re: Problem with understanding basic Java.
Thanks for the replies. I can figure out how to change code around to get things to say what i want and to display different integers and stuff, but only if the framework for the code is already written out. It's a problem with knowing how to insert new classes, how the classes and main methods link/work together etc.
If you imagine a car throttle. It could look something like this:
Pedal -----> Throttle Cable -----> Engine.
Pedal does nothing without a throttle cable, yet throttle cable will do nothing without being initialised by the pedal.
That sort of thing, but obviously exchanging throttle for project ---> class ---> main method ---> variables....i hope this makes sense!
-
October 19th, 2011, 08:19 AM
#6
Re: Problem with understanding basic Java.
 Originally Posted by swiftpunch
...i hope this makes sense!
It's like learning how to read. First it's all gibberish and then in a sudden it all makes sense.
Why not consider small example programs in a "dummies" book as I suggested and study how code is added to make larger programs.
-
October 19th, 2011, 01:31 PM
#7
Re: Problem with understanding basic Java.
Things didn't start coming together until like my junior/senior years. I had a lot of questions about how things worked and why they worked a certain way, and I didn't get them answered until that point. And I still have a lot to learn! The catch-22 thing is that lower-level classes try to abstract things and don't mention a lot of the hidden stuff going on in the background so that you aren't overwhelmed with concepts, but this can end up with you becoming confused and wishing you DID know so you can understand how everything is linking together.
I'd say the best way to go is start researching on a retailer site like Amazon to see what the popular, well-rated Java books are. Look for ones made for new programmers that have plenty of examples and exercises. One trick is to find a syllabus for current classes being taught in colleges and see what book they're reading since they're aimed for students. If provided, you can even try the homework/project assignments.
Also, though it may seem counter intuitive, it helps to learn multiple languages at once. You begin to see similarities between them, and it helps you learn concepts faster imo. However, you'll definitely want to have the basics down first such as classes, polymorphism, overloading, etc.
Last edited by Nez; October 19th, 2011 at 01:35 PM.
-
October 19th, 2011, 03:25 PM
#8
Re: Problem with understanding basic Java.
A good read is Bruce Eckel's Thinking in Java, available online here.
Also do as dlorde suggested and read the Java Tutorials.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|