123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|647|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> Java Syntax

Sun, 04 Mar 2012, 17:02
dna
I'm getting errors when I try to run this:



What did I do wrong?


-=-=-
DNA
Sun, 04 Mar 2012, 17:24
JL235
It isn't Java.

But if I run it as JavaScript, I get:


The problem is with this line:

You are calling 'job()', but job is being used as a field, which holds "programmer". So you need to actually do:

Sun, 04 Mar 2012, 21:22
dna
The tutorial that I'm going through informs me that it is JAVA. The whole thing is supposed to be JAVA.

Are the two languages the same or similar on some levels?

-=-=-
DNA
Sun, 04 Mar 2012, 21:36
JL235
The code is JavaScript, no Java, and they are totally different.

Java was developed at Sun Microsystems. It's class based statically typed language.

LiveScript was a language developed at NetScape, independently of Java. It is a functional-prototype based, dynamic language. It doesn't support classes, and it isn't static.

LiveScript was later renamed to JavaScript as a part of a marketing deal signed between NetScape and Sun Microsystems, to help popularize Java.

Apart from using curly braces, there is almost no relationship between Java and JavaScript. They work differently, and are entirely different languages.
Mon, 05 Mar 2012, 20:48
dna
I'll start from the beginning again.
there's something I missed in the syntax.

-=-=-
DNA
Tue, 06 Mar 2012, 05:21
CodersRule
DNA, https://codecademy.com/ is most certainly teaching JavaScript.
Tue, 06 Mar 2012, 20:45
dna
You're right.

I got so engrossed with the tutorials that I wrote the wrong title.

Still, I'll need to review the spot that I missed.

It does seem to me that certain constructs are similar in function to types. I was learning earlier and was having trouble until I recognized that the function = Object();
worked similar to types.
For me it seems so.

-=-=-
DNA