考慮下面的代碼: import java.util.Calendar;
class Demo
{
class Calendar {}
public static void main (String[] args) {
// System.out.println(Calendar.DAY_OF_WEEK); // Would be an error.
我記得我曾經是能夠做到這一點,必須按預期工作變量名: class foobar
{
public:
foobar(int x, int y)
{
x = x; //the variables x, y belonging to the class got correctly initialized
y = y;
}
private: