Discussion Locked

A few quick Java questions

0 helpful
15 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm debating if I should learn Java, since (a) I find the syntax a lot easier to understand than C++ (no pointers or -> or :: and such; I somewhat understand those but C++ still reads very cryptic to me), (b) I know C# already so Java shouldn't be that difficult, and (c) Netbeans 5.0 and Matisse is the best GUI builder I have ever seen [even better than VS.NET 2005!). However, a few quick questions:

1) Any good books to learn? I've skimmed through the online tutorials at Sun, but they leave a bit to be desired.. I prefer books that demonstrate the basics, but also show how it can be applied to the real world by having a case study example or something, so that when you finish the book you know the language *and* have a working sample to demonstrate.

2) Maybe I'm ignorant and have been living under a rock (or maybe I just never really paid Java any mind until recently...) but since Java can be written as Applets that display in a web browser, Java should be (or is it already??) the greatest language ever for creating web applications, since you can make it function like a desktop application with dialog boxes and tab controls and whatnot without worrying about the web part; i.e. no HTML mashup with server-side functionality like ASP.NET; I can have all the features of a GUI displayed to anyone, anywhere. Maybe that *is* what Java does and I've just been unaware of it until now... it just seems perfect for developing, say, web-based CRM or ERP solutions since you avoid the hassle of laying out a page in HTML first or having to use Javascript or AJAX to simulate app functionality.. maybe there's something I'm missing.

3) I understand that Java's main appeal now is in web, and not so much Desktop applications.. in fact I know of hardly any business software that's written in Java.. I'm not abandoning my C++ studies, because it's still used, but career-wise is it a good move to even *learn* Java if I plan to do more software development than web? Or is Java's future pretty much relegated to JSP and EJB (which I'm not even sure really what it IS..)and if I learn it all I should learn it for JSP technology only?

4) Brings up a point from #3.. what exactly *is* the difference between J2SE (or JSE I guess its called now; I think they dropped the 2?) and the EE version? From what I've read, the EE seems more like a web service, with an n-tier architecture and using services to connect to desktop or web clients. Maybe I'm just not familiar with the Java terminology, so if someone could explain it as "It's like [blah] in .NET" I could probably get it easier. If that's too much to ask, any links to sites that explain it better would be appreciated, as well :)

Thanks for bearing along with the relatively n00b-like Java questions.. as I said I'm only now debating learning it since I think it might be useful in the future, but want to see if my thinking is right or not.

Thanks again,
Wayne

15 replies

by Member 30634329

I'm not a Java expert by any means, but I do have a few years experience with J2EE and Java development.

1) First you'll want to learn the Java language. I learned from the book "Ivor Horton's Beginning Java 2". Takes you from "hello world" to a fully functional graphics app. Next you may want to learn JSP, then J2EE.

2) Java's big strength is its "portability". You can write an application, a client-side applet, or server-side code such as JSP and beans...and all that code will port more easily to different OS and databases. It is very suited to web applications, you can create a pretty "rich" client without being tied to a particular platform.

3) It depends on what you are trying to accomplish. While you could certainly write a fully functional client application in straight Java, it's greatest strength is in its n-tier development...using J2EE.

4) Basically J2SE includes components for client-side PC application development. It includes the Java Runtime engine (JRE - required to run a Java application) as well as the SDK (which includes the classes you need to build apps). J2EE includes everything in J2SE but it also includes components to build larger scale n-tier applications. These components include an application server -- which runs Servlets and Beans. JSP is an example of a servlet. The best way to think about a Bean (JavaBean or EnterpriseJavaBean) is that it is a Java class that runs on a server whose methods can be accessed by multiple clients.
A good book on J2EE is "Beginning J2EE1.4:From Novice to Professional".

by f.montero

1. You might try Java programming for C/C++ developers, a 44-page pdf file from ibm.com/developerWorks.

2. They also have an interesting and practical tutorial.

Yours aye, fjm

by apotheon

Applets sound great in theory, but they're pretty awful in practice. They're far too resource-hungry for what they do, they're not nearly as platform-independent as one would think, and a lot of people simply won't be able to use the things if you include them in your web development -- many don't have a Java plugin installed, and even those who do may not have the right one for your applet. Additionally, applets can be a security concern, because you're talking about asking someone to run foreign code on their computers. Markup rendering and some pared-down Javascript functionality (such as with AJAX) is far more easily used without worrying about system security being compromised.

Truthfully, for browser-embedded applet functionality, Flash is better than Java (and I don't like Flash, either).

by obiwaynekenobi

Wouldn't that be a non-issue if you were using the Applet as a rich web app in a corporate environment? That's the main reason I am asking about it.. with web-based applications being all the rave lately for CRM/ERP/whatever, wouldn't it be better to be able to write a full-featured applet to do the work instead of relying on a hackjob mix of HTML, Javascript and the server-side language du jour? I can do web development just fine, but I get frustrated with having to do a mash-up to get the functionality I want (such as using AJAX) when it's so much easlier to develop a desktop app (and gives the developer more control). Again, maybe I am missing something when it comes to Applets.

by borshee

Well, I've been using java for just over 2 years now and there is still about 70% still to discover.
Basically applets run in a browser environment only and run in a 'sandbox' environment for security reasons and have no access to the system of the PC they are running on or you could just imagine the possibilities open for hackers.
If you want a desktop app, just build a desktop app and run it with the java re and it will run like any other app programmed in C++, Visual basic etc., just without the .exe extension, so it runs on any system with the JRE on it. It is possible to build just about any desktop app out there as far as I know. You can also build in server and database connectivity to any application.
I am unfortunately not too clued up on J2EE but that's the next step...
If you want a good book to get into the basics of Java and more, read Bruce Eckle's 'Thinking in Java'. I found this to be a really comprehensive book on the language and I think this guy knows Java backwards.
I personally think Java is great and better than the others out there as it's pretty easy to get up and running and the portability is better than any other language that I know of!
Good Luck.

by vionescu

For learning Java try "Head First Java" or "Thinking in Java". You will need also an IDE to program in. Try Eclipse for pure Java (www.eclipse.org). It is great, the refactory kicks ass (Visual Studio's ass for sure). Later, for J2ee, you will be in the position to choose your favourite one. Applets are kind of dead now. The new toy is Ajax. For desktop applications for windows, go for C#. For enterprise web applications, go for java. For small to medium web applications you'll be much more productive with php. With java/j2ee you will configure tons of xml, you will use tons of opensource libraries (and each of them usually comes with something to configure), it will be kind of frustrating for a while, but you will find the whole process intlectually rewarding. Learn how to use ant to build or manage configurations, it's crucial. It's very important to focus on object oriented and patterns stuff, not on new toys and hype.

by allaroundit

Write once run anywhere is touted as one of the primary benefits of java, however doesn't hold true since there is a dependance on libraries. And if you've developed java apps, almost anyone will tell you that you will run into issues.

I'd stick with .NET if I were you unless you want to be in the open source movement and enjoy that community. Recent surveys have suggested .NET in the enterprise has outpaced java (66% to 46%). The market is starving for .net resources and it's ranked as the #1 skillset.

I'm just saying that this is where the demand is these days. (Not saying there is no demand for java - but where I work we have a more difficult time finding .net resources, primarily because they get hired out from under us.)

I'm also suggesting that both are good skillsets, but I'm not sure why you are looking to change camps. That's the fundamental question - what are you looking to accomplish.

There are many opportunities out there for either skillset. You'll likely have a more difficult time trying to get a java dev job unless you take a more junior level position(which I'm assuming you are more of a senior level resource).

by jrl21

Since you can show off your java applications over the internet it's perfect a developer like you who may not be quite ready to leave all the web development behind. And yes having a C++ background definately helps a lot. I definately benefited from my C background alone, as a beginning programmer. And it looks like Java's going to be doing a whole lot more than C++. So I urge you to come along and ride the exciting Java wave.

by jzajac2

I learned Java from scratch with minimal programming knowledge. The most useful resource I found was called: Ground-Up Java by Philip Heller. It comes with some handy animated illustrations and teaches, well, from the ground up. Check it out at Borders or whatever, its sort of pricy.

by jslarochelle

Java is still a good choice for several reasons:
1)It is a good language (powerful enough yet simple enough)
2)If you write simple applications you will be able to port them with little modifications. Java is still one the few true contenders for portability (certainly better than .NET).
3)Capitalize on the incredible amount of material available for Java (books, articles, free tools)
4)The Java community

It is not true to say that Java is not good for desktop. I use several desktop Java application everyday starting with Eclipse.

Good luck
JS

by m.lesniak

I'm in the same situation; learning both C++ and Java. I found that "Java:How to program" by Deitel & Deitel, published by Prentice Hall (6th edition) is very good, but it's a heavy book even in paperback. It's designed for students, is 1576 pages long and comes with a CD-ROM. The UK price is ?43.99. If you like working examples then this book has plenty of them.
I'm learning object-oriented programming by using Java as an Open University course. The course employs the free BlueJ IDE, which is again designed for students of Java and is therefore very simplified. Like a lot of things written in Java it takes a while to load into memory, especially the first time around.
I think that it's worth sticking with Java, but not exclusively, because there are so many applications out there that are already written in it. The company that I work for uses a product knowledge application that is written in Java based on an Oracle database. It's a large system supplied by EDS. I don't think a company as large as EDS would bother with Java if it didn't fit the bill for them.

by polinastya-techrepublic

I found Bruce Eckel's "Thinking in Java" to be an ideal learning book. He has a knack for producing simple examples that teach just what he's focusing on and no more. It really helps.

by smiklakhani

I'm a student from East Africa studying under the International Baccalaureate curriculum. I'm taking Computer Science at the Higher Level, and one of the major requirements is that I learn Java. So before the year began I started learning Java on my own from scratch using the following tutorial:

http://chortle.ccsu.edu/CS151/cs151java.html

It's simply brilliant and starts you off right at the basics and builds you up with real life applications. Of course, you might want to have the extensive Sun tutorial at hand to cover some advanced theory. Good Luck.

by obiwaynekenobi

Thanks everyone for the replies. Some comments:

1) I am not planning to change camps; I am just looking to increase my marketability by learning another programming language. I plan to concentrate on .NET, but my reasoning is that it can't hurt me to learn Java as well, especially with its similarity to C#. For the same reason I haven't abandoned my learning of C++. I would like to learn some more PHP (I dabbled in it long ago but didn't really get far) as well. The main problem is that I have to study it on my own time as none of it is used at my job.

2) I honestly dislike web development; I can do it, but it gets on my nerves due to all the workarounds you need to do in applications to get similar functionality to a desktop application (e.g. AJAX). I do it at my current job (using outdated technology, but that's another rant) because I needed the work (I was out of work for about six months beforehand). I keep my web skills relatively current, but it's not something that I prefer to do. I would love to get a "real" programming/development job.

This discussion is closed to new replies.