0

I am a new developer, and usually mess around in JS Fiddle and Chrome developer tools. When looking at answers on Stack Overflow, I noticed that user started with public class and static void. Why don't I have to do this in Developer Tools?

Andre Silva
  • 4,782
  • 9
  • 52
  • 65
JavaOkapi
  • 1
  • 1

1 Answers1

1

Java and JavaScript are not the same thing.

Put simply, Java is a lower level language, designed for server side operation or operation in applets, while JavaScript was originally designed to add interactivity to websites (notably to the usually static HTML content). It has since evolved into the server-side space as well, but there's no need to confuse you with those terms right now.

Today, the two languages have no more common ground than any other two programming languages.

What you see in Dev tools is JavaScript. JS in JS Fiddle stands for "JavaScript".

It's very unlikely you're using Java in your browser, actually. Example Java apps include: Android applications, Eclipse (a code editor suite), your ATM's software, etc. Example JavaScript apps include everything you see on the web on the popular sites: whenever something animates, makes a sound, reacts to your keyboard or mouse input or shows you 3D content without loading Flash or similar plugins, you're usually dealing with JavaScript.

Community
  • 1
  • 1
Swader
  • 11,387
  • 14
  • 50
  • 84
  • Java was designed for things like set top boxes and other embedded applications. http://en.m.wikipedia.org/wiki/Java_(software_platform)#History – Dave Newton Jul 24 '14 at 23:05