package com.test.java;
public class Pen {
String name="Aravind";//non static member
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
displayName();
}
static void displayName(){
Pen p=new Pen();
System.out.println(p.name);
}
}
Output:
Aravind
public class Pen {
String name="Aravind";//non static member
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
displayName();
}
static void displayName(){
Pen p=new Pen();
System.out.println(p.name);
}
}
Output:
Aravind
No comments:
Post a Comment