Java: From Basics to RESTful Services
Introduction to Java programming covering basics, OOP concepts, and building RESTful services.
Why Java? Hundreds of reasons can be found with a single google search, but we all know Java language is not perfect. But the following two reasons are enough to convince anyone: leading development platform (brings business) and JVM. The Java platform will not go anywhere in the near future, and languages like Groovy will make certain of that.
Hello World in Java:
package hello;
public class Hello {
public static void main(String[] args) {
System.out.println("Hello");
}
}
Compile with javac Hello.java and run with java Hello.
Creating a JAR file:
jar -cf hello.jar Hello.class
To run with arguments:
java Hello arg1 arg2 arg3
To run with classpath:
java -cp <path> Hello <args>
To learn RESTful Services, follow the articles written here: