What is wrong with my code? Compiler says non static variable cannot be referenced from a static context
package nestedclass;
public class Nestedclass {
class Student {
String name;
int age;
long roll;
public Student(String name, int age, long roll) {
this.name = name;
this.age = age;
this.roll = roll;
}
public void show() {
System.out.println("name : "+name+" age : "+age+" roll : "+roll);
}
}
public static void main(String[] args) {
//Nestedclass=new Nestedclass();
Student ob=new Student("ishtiaque",10,107060);
ob.show();
// TODO code application logic here
}
}