好吧,我被困在4& 5尚未开始6。不寻找任何人这样做只是希望得到一些帮助完成4& 5并且可能会对代码提供任何反馈。
测试您的程序 创建一个名为Demo.java的类。该类将包含您的main方法 使用默认构造函数创建类的实例。 调用所有对象集方法,为对象赋值 调用对象显示方法,打印出它的值 使用参数化构造函数创建类的另一个实例 调用对象显示方法,打印出它的值
public class Coffee {
//Instance Variables
private double sugar;
private int milk;
private boolean heat;
//Constructor
public Coffee (double id, int dairy, boolean temp )
{
sugar = id;
milk = dairy;
heat = temp;
}
// (setter)
public void setSugar(double id){
sugar = id;
}
public void setMilk(int dairy){
milk = dairy;
}
public void setSize(boolean temp){
heat = temp;
}
//(getter)
public double getSugar(){
return sugar;
}
public int getMilk(){
return milk;
}
public boolean temp(){
return heat;
}
//Method to display data, (need to work on this)
static void display()
{
System.out.println("You added +sugar+ tablespoons of sugar to your coffee");
System.out.println("You have +dairyin your coffee");
System.out.println("That's a +size+ ounce cup");
}
//Default Constructor (need help with setting heat to a default)
public Coffee() {
sugar = 0;
milk = 0;
heat = 0;
}
}
答案 0 :(得分:1)
using System.Linq;
...
using(var ctx = new CmsContext())
{
var allEntitiesInSet = ctx.Set(_tableName).ToList();
}
你走了。我已将您的布尔私有成员热重命名为isHot。