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.javaMyFirstApp.java:1: class MyfirstApp is public, should be declared in a file named MyfirstApp.javapublic 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.
No comments:
Post a Comment