accessor

    -1熱度

    1回答

    我已經嘗試了一切,並且eclipse始終返回錯誤「方法getX()未定義類型Point」。下面是這個錯誤出現在代碼: public class Rectangle { double Height; double Width;//Variables for the class double x; double y; public Rectangle(Point p, double widt

    0熱度

    1回答

    我試圖動態訪問一個包含在字符串中的屬性值的對象。示例如下: var toolState = { draw_point: false; draw_line: false; } var dynamicText = "draw_point"; toolState.dynamicText = true; //here is the problem 我對JS相當陌生。對不起

    -1熱度

    2回答

    好吧,我做了三個類。一個是測試人員,另外兩個是藍圖班。我似乎無法將藍圖類ScanShop中的私人雙重購物車變量稱爲ShoppingCart。我想過使用訪問器和getter,但是我現在混淆了自己,不知道自己出錯的地方。這裏是我的代碼: package exercise3; import java.util.Scanner; public class ScanShop { private do

    -1熱度

    2回答

    我不能找出爲什麼以下(大大簡化)代碼返回錯誤error: 'm_sID' was not called in this scope: #include <iostream> #include <string> ////////////////////////////////////////// //header class Person { private: std::str

    0熱度

    3回答

    我只是覺得現在真的很笨,你能幫我解釋爲什麼我用這個簡單的代碼有保護級別問題嗎?我甚至試圖把它通過對象,但仍然保護水平問題。 class A { int first, second, add; public void input() { Console.WriteLine("Please enter the first number: ");

    32熱度

    2回答

    有沒有辦法在TypeScript中擁有一個屬性的私有setter? class Test { private _prop: string; public get prop() : string { return this._prop; } private set prop(val: string) { //ca

    0熱度

    1回答

    我目前正在寫一個javascript腳本。 employe.name = Remi employe2 = Object.create(Employe); employe2.name = Vautrin console.log(employe.name);//Vautrin instead of Remi 我只是想知道如何複製一個完整的對象。我已經嘗試過: //StackOverFlow

    -4熱度

    4回答

    以下是我必須完成的Java程序的指令和代碼。我卡住了,不知道如何繼續。我試圖弄清楚這一點。我覺得我不知道我在做什麼。所有的幫助,方向和解釋將非常感激。 寫了一個名爲Car類具有以下字段: yearModel:該yearModel場是保持汽車的年模型的int。 make:該make字段引用一個字符串對象,其中包含汽車的品牌。 speed:speed字段是保存汽車當前速度的int值。 此外,類應該有下

    1熱度

    2回答

    是否有可能在Laravel 4使用的存取進行比較,例如: class User extends Eloquent { // define Accessor public function getSpecialNameAttribute() { return 'Joda'; } } $User = User::where('gender'

    0熱度

    2回答

    對不起,可怕的格式,但我只是想知道如果以下將被視爲Accessor。 所以我的類定義看起來是這樣的...... class work { public: void getInput(); //Mutator void output(); //Accessor? //... 因此,這裏的功能.. void work::output() {