润
润五月
Unregistered / Unconfirmed
GUEST, unregistred user!
[red]这段程序编译可以通过,执行的时候报错![/red]
源程序如下:
import java.io.*;
public class TestHiddenField
{
public static void main(String args[])
{
D200_Card my200=new D200_Card();
my200.balance=50.0;
System.out.println("父类被隐藏的金额为"+my200.getbalance());
if(my200.performDial())
System.out.println("子类的剩余金额为:"+my200.balance);
}
}
abstract class PhoneCard
{
do
uble balance;
abstract boolean performDial();
do
uble getbalance()
{
return balance;
}
}
abstract class Number_PhoneCard extends PhoneCard
{
long cardNumber;
int password;
String connectNumber;
boolean connected;
boolean performConnection(long cn,int pw)
{
if(cn==cardNumber&&pw==password)
{
connected=true;
return true;
}
else
return false;
}
}
class D200_Card extends Number_PhoneCard
{
do
uble additoryFee;
do
uble balance;
boolean performDial()
{
if(balance>(0.5+additoryFee))
{
balance-=(0.5+additoryFee);
return true;
}
else
return false;
}
do
uble getBalance()
{
return balance;
}
}
错误信息:
Exception in thread "main" java.lang.NoClassDefFoundError:
C:/Documents and Settings/Administrator/Desktop/TestHiddenField/class
源程序如下:
import java.io.*;
public class TestHiddenField
{
public static void main(String args[])
{
D200_Card my200=new D200_Card();
my200.balance=50.0;
System.out.println("父类被隐藏的金额为"+my200.getbalance());
if(my200.performDial())
System.out.println("子类的剩余金额为:"+my200.balance);
}
}
abstract class PhoneCard
{
do
uble balance;
abstract boolean performDial();
do
uble getbalance()
{
return balance;
}
}
abstract class Number_PhoneCard extends PhoneCard
{
long cardNumber;
int password;
String connectNumber;
boolean connected;
boolean performConnection(long cn,int pw)
{
if(cn==cardNumber&&pw==password)
{
connected=true;
return true;
}
else
return false;
}
}
class D200_Card extends Number_PhoneCard
{
do
uble additoryFee;
do
uble balance;
boolean performDial()
{
if(balance>(0.5+additoryFee))
{
balance-=(0.5+additoryFee);
return true;
}
else
return false;
}
do
uble getBalance()
{
return balance;
}
}
错误信息:
Exception in thread "main" java.lang.NoClassDefFoundError:
C:/Documents and Settings/Administrator/Desktop/TestHiddenField/class