@@ -0,0 +1,876 @@
+class Pwr %7B%0A%09double b;%0A%09int e;%0A%09double val;%0A%09%0A%09Pwr(double base, int exp) %7B%0A%09%09b = base;%0A%09%09// this.b = base;%0A%09%09e = exp;%0A%09%09// this.e = exp;%0A%09%09%0A%09%09val = 1;%0A%09%09// this.val = 1;%0A%09%09if(exp==0) return;%0A%09%09for( ; exp%3E0; exp--) val = val * base;%0A%09%09// for( ; exp%3E0; exp--) this.val = this.val * base;%0A%09%7D%0A%09%0A/*%0A%09Pwr(double b, int e) %7B%0A%09%09this.b = b;%0A%09%09this.e = e;%0A%09%09%0A%09%09val = 1;%0A%09%09if(e==0) return;%0A%09%09for( ; e%3E0; e--) val = val * b;%0A%09%7D%0A*/%0A%09%0A%09double get_pwr() %7B%0A%09%09return val;%0A%09%09// return this.val;%0A%09%7D%0A%7D%0A%0Aclass DemoPwr %7B%0A%09public static void main(String args%5B%5D) %7B%0A%09%09Pwr x = new Pwr(4.0, 2);%0A%09%09Pwr y = new Pwr(2.5, 1);%0A%09%09Pwr z = new Pwr(5.7, 0);%0A%09%09%0A%09%09System.out.println(x.b + %22 raised to the %22 + x.e + %22 power is %22 + x.get_pwr());%0A%09%09System.out.println(y.b + %22 raised to the %22 + y.e + %22 power is %22 + y.get_pwr());%0A%09%09System.out.println(z.b + %22 raised to the %22 + z.e + %22 power is %22 + z.get_pwr());%0A%09%7D%0A%7D%0A

The this keyword