خرید بک لینک

با سلام خدمت دوستان عزیز.
من تازه کار هستم .
با خطای زیر روبرو شدم.
non-static variable this caot be referenced from a static contextاینم از کدی که در حال نوشتن اون بودم. به نظرتون مشکل کار من از کجاست؟

package firstjavaprogram;
import firstjavaprogram.Firstjavaprogram.Box;
/**
*
* @author Ghs
*/
public class Firstjavaprogram {
public class Box
{
double width;
double height;
// structors Section
Box(double width , double height)
{
this.width=width;
this.height=height;
}
Box()
{
this.width=5;
this.height=2;
}
// methods Section
public double mohiteMostatil ()
{
retu width*height;
}
public double masahat ()
{
retu width*4;
}

}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
در این خط خطا رخ میدهد Box myBox = new Box(5,2);
System.out.print(myBox.masahat());

}

}

برچسب: نویسنده: محمد رضا جوادیان تاريخ: شنبه 14 فروردين 1395 ساعت: 6:16

صفحه بندی