.....................................
.......................
ما هو تفسير الخطاء "Not a Statement" ؟؟ ومتى يحدث ؟؟ ولماذا حدث في هذا البرنامج ؟
class Student {
int a=0;
static int b=0;
Student(){
b++;}
public void showData(){
System.out.println("Value of a = "+a);
System.out.println("Value of b = "+b);
}
}
class Demo
{
public static void main(String args[])
{
Student s1 = new Student();
s1.showData();
Student s2 = new Student();
s2.showData();
Student.b; //لا يحدث حطاء لماذا b++ عند وضع
}
}