Check out example codes for "how to print hello world in java". It will help you in understanding the concepts better.

Code Example 1

class Simple{  
    public static void main(String args[]){  
     System.out.println("Hello Java");  
    }  
}

Code Example 2

public class Hello
{
  	public static void main(String[] args)
    {
      /*Tip System.out.println(); shortcut Type 'sysout'and press Tab */
      System.out.println("Hello world!");
    }
}

Code Example 3

Sprite.prototype.myMove = function (){
	var elem = document.getElementById("avion1");   
	var pos = 0;
	var id = setInterval(frame, 10);
	function frame() {
	  if (pos == 550) {
		clearInterval(id);
	  } else {
		pos++; 
		elem.style.top = pos + 'px'; 
	  }
	}
  }
//using requestAnimationFrame
var start;
var stopId;
var progress;
var toggle = false;

var element = document.getElementById('avion1');

function step(timestamp) {
  if (!start || progress > 400) start = timestamp;
  progress = (timestamp - start) / 10 + 50;
  element.style.top = progress + 'px';
  stopId = window.requestAnimationFrame(step);
}

function toggleAnimation() {
  if (!toggle) {
    toggle = true;
    window.requestAnimationFrame(step);
  } else {
    toggle = false;
    cancelAnimationFrame(stopId);
  }
}

Learn ReactJs, React Native from akashmittal.com