learn-js.org
Objects - Learn JavaScript - Free Interactive JavaScript Tutorial
http://www.learn-js.org/en/Objects
JavaScript is a functional language, and for object oriented programming it uses both objects and functions, but objects are usually used as a data structure, similar to a dictionary in Python or a map in Java. In this tutorial, we will learn how to use objects as a data structure. The advanced tutorials explain more about object oriented JavaScript. To initialize an object, use curly braces:. Var emptyObject = {}; var personObject = { firstName : "John", lastName : "Smith" }. For (var member in personOb...
learn-js.org
Operators - Learn JavaScript - Free Interactive JavaScript Tutorial
http://www.learn-js.org/en/Operators
Every variable in JavaScript is casted automatically so any operator between two variables will always give some kind of result. Addition) operator is used both addition and concatenation of strings. For example, adding two variables is easy:. Var a = 1; var b = 2; var c = a b; / c is now equal to 3. The addition operator is used for concatenating strings to strings, strings to numbers, and numbers to strings:. Var name = "John"; console.log("Hello " name "! JavaScript supports the modulus operator (.
learnjavaonline.org
Compiling and Running with Arguments - Learn Java - Free Interactive Java Tutorial
http://www.learnjavaonline.org/en/Compiling_and_Running_with_Arguments
Compiling and Running with Arguments. Compiling and Running with Arguments. This section is used for you to use Java at home and understand the basics of how things are done. After creating a simple application that prints something to the screen, you need to compile your code and run it. It shouldn't really matter if you use Linux, Mac or Windows. You need to have a console and you need to have the following commands available in order to compile and run Java. Java (or java.exe). Javac (or javac.exe).
learnjavaonline.org
Variables and Types - Learn Java - Free Interactive Java Tutorial
http://www.learnjavaonline.org/en/Variables_and_Types
Although Java is object oriented, not all types are objects. It is built on top of basic variable types called primitives. Here is a list of all primitives in Java:. Number, 1 byte). Number, 2 bytes). Number, 4 bytes). Number, 8 bytes). Float number, 4 bytes). Float number, 8 bytes). A character, 2 bytes). True or false, 1 byte). Java is a strong typed language, which means variables need to be defined before we use them. To declare and assign a number use the following syntax:. Or you can combine them:.
learnjavaonline.org
Functions - Learn Java - Free Interactive Java Tutorial
http://www.learnjavaonline.org/en/Functions
In Java, all function definitions must be inside classes. We also call functions methods. Let's look at an example method. Public class Main { public static void foo() { / Do something here } }. Is a method we defined in class Main. Notice a few things about. Means this method belongs to the class Main and not to a specific instance of Main. Which means we can call the method from a different class like that. By itself to exit the method. Public void bar(int num1, int num2) { . }. Value get copied to.
learnjavaonline.org
Hello, World! - Learn Java - Free Interactive Java Tutorial
http://www.learnjavaonline.org/en/Hello,_World!
Java is an object oriented language (OOP). Objects in Java are called "classes". Let's go over the Hello world program, which simply prints "Hello, World! Public class Main { public static void main(String[] args) { System.out.println("Hello, World! The first line defines a class called Main. Public class Main {. In Java, every line of code that can actually run needs to be inside a class. This line declares a class named. The next line is:. Public static void main(String[] args) {. The arguments we get ...
learnjavaonline.org
Learn Java - Free Interactive Java Tutorial
http://www.learnjavaonline.org/en
Welcome to the LearnJavaOnline.org Interactive Java Tutorial. Whether you are an experienced programmer or not, this website is intended for everyone who wishes to learn the Java programming language. Just click on the chapter you wish to begin from, and follow the instructions. Good luck! Compiling and Running with Arguments. Advanced Topics (Under Construction). Read more here: Contributing Tutorials. Executing, please wait. Powered by Sphere Engine ™.
learnjavaonline.org
Wrappers and Autoboxing - Learn Java - Free Interactive Java Tutorial
http://www.learnjavaonline.org/en/Wrappers_and_Autoboxing
You can contribute this page by forking the repository at: https:/ github.com/ronreiter/interactive-tutorials. Executing, please wait. Powered by Sphere Engine ™.
learncs.org
For loops - Learn C# - Free Interactive C# Tutorial
http://www.learncs.org/en/For_loops
For loops are very similar to for loops in C, They are defined like this:. For( [variable to count iterations] ; [conditions checked for] ; [code to execute every loop]) . Int i; for( i = 0; i 10; i ) . This would loop until i is no longer less than ten, increasing i by one each time. However unlike C, C# does allow you to declare the variable you are using as to count iterations in the for loop:. For( int i = 0; i 10; i ). There are several statements you can use to control a loop:.
learncs.org
Dictionaries - Learn C# - Free Interactive C# Tutorial
http://www.learncs.org/en/Dictionaries
Dictionaries are special lists, whereas every value in the list has a key which is also a variable. A good example for a dictionary is a phone book. Dictionary string, long phonebook = new Dictionary string, long (); phonebook.Add("Alex", 4154346543); phonebook["Jessica"] = 4159484588;. Notice that when defining a dictionary, we need to provide a generic definition with two types - the type of the key and the type of the value. In this case, the key is a string whereas the value is an integer. Using Syst...