• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Types of Applications for Java?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So hopefully this question isn't too stupid, but what types of applications are developed using Java and what advantages does it have over other languages? Other than build once, run anywhere.

I've been programming for a few years mainly games and a few business applications using C++/C#/VBA/VB. I want to expand my knowledge into other languages and Java seems to pop up all over the place in terms of a language employers are looking for. That begs the question, what types of applications are being developed with Java?

I know it's used a lot for the web and I often hear someone say, use Java to make your websites dynamic. I also hear the same thing about Javascript. I know Javascript has nothing to do with Java other than the name was licensed to help the scripting language pick up momentum and build a user base when it came out and it's also a scripting language whereas Java is a OOP language.

So what types of web applications are developed using Javascript and what type of web applications are developed using Java? Is there even a difference or can you build the same types of web applications with either.

Sorry again if that seems like a stupid question, but I'm trying to wrap my head around uses for Java and the differences between it and the types of uses for Javascript as well, if that makes sense.

Thank You for taking the time to read this and give me some feedback.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Stephen, welcome to the Ranch!

What kinds of web applications use Java and Javascript? Well, you're looking at one right now. This forum. And if you've ever bought an airline ticket online, there's a pretty good chance that you used a web application which used Java and Javascript. There's lots more, too.

You'll find that Javascript is used in the browser, to make what the user sees and does more flexible than what can be done with plain old HTML, and that Java is used on the back end, in the server, to do processing like updating databases and keeping track of who is doing what on the site and so on. There isn't really much of an overlap between those two, not in most sites anyway. In other words it isn't Java OR Javascript, it's Java AND Javascript.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

A few special cases aside (like node.js), JavaScript works in the browser, whereas Java works on the server, so there really isn't a one-vs.-the-other decision - for most Java web apps it's "both". Java works on the back end, and JavaScript on the front end.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll target this specific question:

Stephen Day wrote:So what types of web applications are developed using Javascript and what type of web applications are developed using Java? Is there even a difference or can you build the same types of web applications with either.


You are assuming you use one or the other.

In a Java web application, Java is used on the client side to dynamically build the HTML pages that will be sent to the client, usually using servlets and JSP, or a framework built on these technologies. You can find out more about this by reading this article.

JavaScript is used on the client to react to events that take place after the page is sent to the browser (button clicks and so on).

So it's not a matter of either/or, but how these technologies work together in concert.

[Edit: Ulf and Paul were quicker on the draw than I...]
 
Stephen Day
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to thank all 3 of you for your responses to my question. I've posted on a few other forums with either no reply or some reply that had nothing to do with what I asked. Your responses makes a lot more sense to me. Just to make sure I'm clear Java is used on the server side for manipulating data sent from the browser whether that be someone filling out a form or entering in a username and password which then java would compare against the database, etc... and then return a response to the browser where JavaScript would take over and play some animation or sound or start up a browser application, etc...

My last couple questions would be:

1.) If you use Java for the back end (server side) would you still need to use PHP? I ask because it seems like there's 30 different languages out there to build websites, whereas when I just developed desktop apps I used one language and a few API's. I'm guessing though that I would be fine with just knowing HTML, CSS, Java & Javascript.

2.) Does anyone know of any good books/resources that pull everything together? There's plenty of books/videos/courses on the individual languages and technologies, but none that teach you how to finally combine all of them together into a complete cohesive project. Like creating a page layout with HTML/CSS, then creating a javascript application that sends data to the server and now here's our Java code on the server to handle the request. It would be awesome if I could find something that brings all the individual components together.

I do know HTML/CSS and have been picking up Java pretty quick as it's almost exactly like C# minus a few syntax details, next is java script then I want to bring it all together. Thank you again, you guys have been awesome.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephen Day wrote:1.) If you use Java for the back end (server side) would you still need to use PHP?


No. That's what servlets and JSP are for. PHP is its own ecosystem.

2.) Does anyone know of any good books/resources that pull everything together?


Head First Servlets and JSP is a good one, I'm my opinion, for the Java parts. (Disclaimer: I was technical review for the book.)
 
Ranch Hand
Posts: 116
2
Eclipse IDE PHP Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Stephen,

Java can be used for just about anything. I know, that really clears it up right? Java can be and is used for desktop applications, web apps, web services/network services, embedded devices including appliances, mobile application (both android and embedded).

The beauty is if you want say a web based app that you can view via browser, mobile app, desktop app (maybe an admin app or dashboard), with database and network components, you can write it all in 1 language (except the html/css on the webpage).

I agree with Bear, "Head First Servlets and JSP" is a great place to start for the web. Once you are proficient at that you can expand into some of the web frameworks like Spring, JSF, Struts, etc. For desktop app development take a look at Java Swing. It is a library that ships standard with Java SE.

Java has so many uses and so many tools, frameworks, and technologies built from and around it. You'll sprain your brain trying to wrap your brain around all of it. I'd suggest picking an area of interest and focus on that.

Before getting into any of this though you need a solid understanding of the core Java language.

Hope that helps a little.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome again

You do realise Java and Javascript are two completely different and unrelated languages.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephen Day wrote:...what advantages does it have over other languages? Other than build once, run anywhere.


Well, that's actually quite a big advantage; and not really matched by too many others even now after 20 years - unless they run on a JVM. The only one I know of that doesn't is Progress. C# and .NET claim to be platform-independent, but I don't see too much evidence of their penetration into any markets outside Windows.

Another thing: it's free, and doesn't come with a lot of baggage; and because of that, you can build pretty sophisticated systems without an enormous layout in licensing or support fees.

Third: It's mature. If you'd started out with it back in 1997 (or before 1.4.2, anyway), you might have had a few years of hard knocks to get over while they ironed out the kinks; but these days I suspect it has a larger codebase than any other language on the planet. And that means that if something goes wrong, you have an army of help out their in Webland on virtually any subject.

My 2¢

Winston
 
Stephen Day
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you guys again for everything. Everyone here has been really friendly and helpful. I'm sure I'll be back to bother you guys again as I dig deeper in to Java.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic