Thursday, August 21, 2014

A C programmer's transition to Java

Every thing in Java is part of a class.
Every public class gets its own source file with its class name as the file name.
if class name does not match the file name you get this error:
java kamehameha==>javac MyFirstApp.java 
MyFirstApp.java:1: class MyfirstApp is public, should be declared in a file named MyfirstApp.java
public class MyfirstApp {
       ^
1 error




Strings in Java are immutable meaning they cannot be changed once created
Static initializer block of a class: {}


Java bean - A serializable class which has all members private and uses getters and setters.
Static method in Java means that you dont need an instance of the class to invoke the method.