Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Java? Total beginner, need direction!

Author
Message
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 3rd Apr 2011 23:12
I have an interest in learning Java for a few different reasons, the main being developing for Android.

So, I have been searching around online for tutorials and information, but I can't find anything that really goes very in depth in explaining what I'm typing in the example code. For instance, how do I actually know I need to "import java.io" to use keyboard inputs to type strings in my program? What other "imports" are there? What does the public static void main method actually do for me?

I'm just a little lost and it seems I can't find anything that teaches me how to think for myself. I don't want to be a robot and punch in example code.

Any good resources, written or video tutorials out there that anyone can refer me to? Everything I keep finding just seems a little empty, or I'm supposed to have some other programming knowledge of these languages beyond basic, because lets face it, I'm spoiled by DBP.

Also, don't tell me to wait for the AppGameKit I'll check it out when it finally shows it's face, but honestly I really would like to learn how these more advanced languages work!

http://lossofanonymity.wordpress.com
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 3rd Apr 2011 23:19
I found the same problems when I started to learn. The only advise I can offer is the official Java tutorials.

http://download.oracle.com/javase/tutorial/java/index.html

I found it rather useful.
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 3rd Apr 2011 23:20 Edited at: 3rd Apr 2011 23:37
Glad I'm not the only one who has my issue, lol! Thanks, I'll check those out

EDIT: These are great, really helping me wrap my head around OOP, thanks!

http://lossofanonymity.wordpress.com
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Apr 2011 02:14
I started java back in 2003, learned it in college. I would highly recommend getting a book. Look on amazon for used ones. Even older editions on 1.4 can help beginners, there aren't really any differences with 1.6 that you would need to worry about yet.

The java docs (google java docs 1.5) is the most useful thing to look at. You'll have a huge list of all libraries you can import.

The Internet: Where men are men, women are men, and children are federal agents
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 4th Apr 2011 02:30
Thanks Phaelex. I'm actually thinking of seeing if my employer will pay for classes after I get a grounding in Java. I work in IT, so here's hoping haha.

http://lossofanonymity.wordpress.com
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Apr 2011 08:42
They generally won't pay for something that isn't specifically related to your job or doesn't benefit them. And java isn't something you can get a certification in after a week course like many other things.

The Internet: Where men are men, women are men, and children are federal agents
Jimpo
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location:
Posted: 4th Apr 2011 09:00 Edited at: 4th Apr 2011 09:03
Quote: "how do I actually know I need to "import java.io" to use keyboard inputs to type strings in my program?"


Just use Eclipse and use whatever objects you need, then press Shift+Control+O and it will automatically add the import lines to the top of the code.

And working on Android can be pretty different than writing a normal Java program. The OS is structured different where each screen of your app is a separate Activity that can be called independently. You might want to learn Java and Android development in parallel, since you don't need an extensive Java background to get into Android basics and some things from Java aren't used in Android, for example main().

Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 4th Apr 2011 15:12
Thanks, Jimpo!

http://lossofanonymity.wordpress.com
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Apr 2011 01:27
going to keep track of here for when i get into java ^^ pretty soon, I mainly need to get familiar with JavaScript and ActionSctipt... (if you didnt guess it yet, i am almost entirely unfamiliar with Java as a whole however I know of its abilities somewhat)

JoelJ
20
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 5th Apr 2011 05:35
Quote: "Just use Eclipse and use whatever objects you need, then press Shift+Control+O and it will automatically add the import lines to the top of the code.
"

If you don't know why a tool is doing something, you shouldn't be using that tool. You need to learn why you need an import, it helps a lot down the road.

Also, I recommend StackOverFlow.com for finding solutions to programming questions. Often time you don't even have to post a question because someone else already has. And the answers are almost always very concise and helpful.

Your mother has been erased by a mod because it's larger than 600x120
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 5th Apr 2011 17:45
Quote: " I mainly need to get familiar with JavaScript"


Java and JavaScript are completely unrelated. Maybe slightly, but knowing Java will probably not help you with JavaScript
Randomness 128
17
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 5th Apr 2011 20:00
Quote: "For instance, how do I actually know I need to "import java.io" to use keyboard inputs to type strings in my program? What other "imports" are there?"


Somewhere in Java's files are a bunch of jar files. Jar files are basically just zip files, but with certain data meant specifically for Java to use. Their purpose is to store entire Java programs and their required media, Java libraries, etc.

In these particular jar files are a bunch of Java class files organized into different directories. If you want to use, say, a Scanner object, like so:

Scanner input = new Scanner(System.in);

you'd have to import the Scanner class, using either of these:

import java.util.Scanner;
or
import java.util.*;

Somewhere in one of those jar files, is a file with this path:

java\util\Scanner.class

You're telling Java to use that class file, which allows you to use the Scanner class that it contains.

This:

import java.util.*;

is telling Java to use any class within the java\util\ directory that you need.

Here, you can find a list of all of them, along with detailed information about each one.
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 6th Apr 2011 00:55
Really appreciate all the advice, guys

http://lossofanonymity.wordpress.com
lazerus
15
Years of Service
User Offline
Joined: 30th Apr 2008
Location:
Posted: 6th Apr 2011 02:05 Edited at: 6th Apr 2011 02:09
We use this in uni right now.

http://www.bluej.org/

After a few months (3hours a week in uni, 2 at home) of building up all the bases from standard english to coding a entire java trainer program called pie-eater (which we used to start with) i would say my knowledge isnt up to scratch but its getting there at least. I would post some of the presentations we use but im afraid ill be hunted down by my lecturer and flayed alive ;S Managed 90/135 on the written mock test though which was stright up java coding so hes pretty good at what he does

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Apr 2011 02:31
Don't bother with BlueJ, it's a poor program and terrible with any projects involving more than a few classes (which is everything). That's what they had us use in a school rather than teaching us on a more industry standard IDE. No real java developer uses blueJ. And when I tried to report bugs to the creators when vista first came out, they got an attitude with me and said its my fault for using vista.

The Internet: Where men are men, women are men, and children are federal agents
lazerus
15
Years of Service
User Offline
Joined: 30th Apr 2008
Location:
Posted: 6th Apr 2011 02:49
any advice on another program base to use then?

Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 6th Apr 2011 07:16 Edited at: 6th Apr 2011 07:22
ECLIPSE!
http://www.eclipse.org/downloads/ (the first one)

Eclipse is a general IDE, and I think I've read that it's meant to be used as a base, for other people to build off of, but it works great as a standalone java editor. I installed a C/C++ package for it, but never got the compiler and everything properly hooked up.

[edit]
Also, blueJ has few features that most IDEs have. When I used it, I tried selecting a block of code to indent it, and it just replaced the whole selection with a single tab. There isn't any autosense stuff either. I suppose it's a bit more useful than notepad, but not by a whole lot.

In eclipse, if you type in "System.", you get a list of all the members of "System", and some docs on them if you mouse over the commands. That's super nice, because then you don't have to keep going back to online docs to make sure you have the capitalization right!

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Apr 2011 09:17
Quote: "any advice on another program base to use then?"

Touché

I like Netbeans personally, but it can be a little heavy on memory though. I've never used JBuilder, but it's an alternative (it's not free) and I hear it uses globs of ram. Then there's Eclipse, the more likely candidate you'll see used by businesses. We used Eclipse for jsp development.

There's also Jamocha, which is a java-based IDE I wrote for class since my teacher was useless and I got bored with assignments. The last half of my semester I finished using my editor, so I know it works. I wouldn't suggest it for enterprise use, but for schoolwork it was good for me. (better than the unregistered version of textpad that teacher made us use; different college than the bluej one)


The one good thing BlueJ does do is show a visual representation of how classes are linked together. For a beginner that might be a good thing.

The Internet: Where men are men, women are men, and children are federal agents
flashing snall
18
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 6th Apr 2011 13:38
I wrote a quick little power point trying to explain some basic java stuff. Its not very good, but have a look.

Attachments

Login to view attachments
lazerus
15
Years of Service
User Offline
Joined: 30th Apr 2008
Location:
Posted: 6th Apr 2011 14:26
Thanks for the advice guys

Ram wont be an issue at all here or in uni but i like the look of eclipse from its general layout so ill give that a spin first

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 6th Apr 2011 16:36
+1 for netbeans.
BiggAdd
Retired Moderator
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 6th Apr 2011 18:53 Edited at: 6th Apr 2011 18:56
DrJava is great for starting out. Its a simple java file editor with syntax highlighting and a compiler and console built in.

For projects though, I have to say NetBeans is my first choice too.

Jimpo
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location:
Posted: 6th Apr 2011 19:39
Great PowerPoint flashing snall! You did a great job of explaining all the basics.

As for which IDE to use, all of Google's Android tutorials assume you are using Eclipse. Plus, they've released a helpful ADT for it. So if you're focusing on Android dev, Eclipse will be the most convenient.

flashing snall
18
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 6th Apr 2011 22:31
Thanks Jimpo

Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 7th Apr 2011 01:25 Edited at: 7th Apr 2011 01:56
Thanks so much guys. Great help all around. Gonna watch the powerpoint shortly snall, I'll let you know what I think of it

EDIT: Snall, this is great man, thanks! Super handy!

http://lossofanonymity.wordpress.com
JoelJ
20
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 7th Apr 2011 05:58
Just thought I'd toss my two-cents in for the IDE discussion: We use IntelliJ at work, and I really like it. It's pretty slow at startup, but it's actually quite useful. They have a free version.

Your mother has been erased by a mod because it's larger than 600x120
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 7th Apr 2011 09:52
I love NetBeans too, especially for PHP, but it has crazy memory leaks and I have to kill it every once in a while.


Senior Web Developer - Nokia
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Apr 2011 23:41
Yea it's not uncommon for my Netbeans to get over a gb in memory

The Internet: Where men are men, women are men, and children are federal agents

Login to post a reply

Server time is: 2024-04-20 06:09:15
Your offset time is: 2024-04-20 06:09:15