Tag Archives: hello

Introduction to programming in Java

Welcome to the Java programming tutorial series. In this tutorial, I will show you how to download the Java SDK and Netbeans IDE so you can begin coding in Java. You will also learn how to write your very first program in Java – a ‘Hello world’ program.

Watch the video below and then scroll down for the links to the Java SDK and Netbeans IDE downloads and to view the sample code for the example shown in the video.

Downloads

All downloads are available for Windows, Mac and Linux

Sample code

Here is the sample Java code for this tutorial. Keep in mind that the project name in the video example was HelloWorld and so the package in the sample code is also called helloworld.

package helloworld;
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
    
}

Hello world (in C#)

This tutorial is an introduction to Xamarin Studio and the C# programming language. In this video I explain how to create a new solution in Xamarin Studio and cover some of the basics of the C# language. We will create our first program in C# and develop skills in the language before moving on to creating mobile apps.

Watch the video below and then scroll down to see the sample code. Make sure you check out the C# code reference here.

Sample C# code

This code is used in a solution and project both called MyCSharpApp created in Xamarin Studio. If you use this code, make sure your solution, project and namespace are called MyCSharpApp. The code also contains comments (after the double forward slashes) to explain what each statement in the code does.

using System;

namespace MyCSharpApp
{
  class MainClass
  {
    public static void Main (string[] args)
    {
      Console.WriteLine ("Hello, this is my first C# app"); // this displays a message in console
      Console.ReadLine (); // this waits until the user enters something
    }
  }
}

Next tutorial: Variables and strings in C#

Hello World

The code below can be copied to a HTML file. The HTML code contains JavaScript code which will basically display a “Hello world” message in the browser window. The code also shows examples of using single-line and multi-line comments. Simply copy and paste the code snippet into a text editor and save the file as yourfilename.html

You can also watch the video explaining how to get started with JavaScript here.

<!DOCTYPE html>
<html lang="en"
<head>
 <meta charset="utf-8"/>
 <title>JavaScript intro</title>
 
 <script type="text/javascript">
 
 document.write("Hello world");
 
 // This is a single-line comment
 
 /*
 This is a multi-line comment.
 Line 9 prints a simple message using a write statement.
 The semi-colon means that is the end of the statement. It is placed at the end of the line.
 */
 
 // To check errors you can use Browser Console (Firefox) or Console (Chrome and IE).
 
 </script>
 
</head>
<body>
 
 
</body>
</html>