Skip to content

Instantly share code, notes, and snippets.

@karan-ta
Created November 9, 2016 06:05
Show Gist options
  • Save karan-ta/1ed7f1f84c26359dbd827f075238c077 to your computer and use it in GitHub Desktop.
Save karan-ta/1ed7f1f84c26359dbd827f075238c077 to your computer and use it in GitHub Desktop.
//Lesson1neeraj.java
public class Lesson1neeraj{
//instance method
private void sayHello(String name){
System.out.println("Hello "+name);
}
public static void main(String[] args){
{1,2,3,4,5,6}
String[] args = null
System.out.println("Hello World");
System.out.println("Hello "+args[0]);// array index out of bounds exception
Lesson1neeraj lesson = new Lesson1neeraj();//creating instance/object
lesson.sayHello(args[0]);
//any questions ??
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment