所以我一直在我的類文件的構造函數中使用String數據類型,當一切正常編譯時,當我運行應用程序文件時,程序沒有給出預期的結果。我一直是短的,看它是否會工作,所以我的類文件如下: public class StringPractice
{
private String color;
private String brand;
public StringPractic
僅僅使用公開的屬性或者我應該製作一個私人字段_count是否正確?我已閱讀關於該主題的一些信息,但我找不到答案。 public int Count
{
get
{
if (this._feeds.IsValueCreated)
{
return this._feeds.Value.Count;
}
else
裏面我有一個索引類: public class SpecialArray<T>
{
public T this[long index]
{
get { return SpecialGetFunction(index) }
set { SpecialSetFunction(index, value); }
}
private voi
我使用Ruby和我已經覆蓋了一些默認的訪問方法,這種方式更新的屬性: class Article < ActiveRecord::Base
def title
self.get_title
end
def content
self.get_content
end
end
self.get_title和self.get_conten