如何設置對象的名稱空間?爲C中的對象創建名稱空間#
現在我必須按以下方式使用一個對象。 MyFirstTestCase tc = new MyFirstTestCase();
MyFirstTestCase tc = new MyFirstTestCase();
tc.dothis();
tc.dothat();
// ...
我想以這種方式使用對象。 MyFirstTestCase tc = new MyFirstTestCase();
MyFirstTestCase tc = new MyFirstTestCase();
using tc;
dothis();
dothat();
// ...
但這不起作用。我怎樣才能做到這一點?
澄清我的意思。
// MyFirstTestCase is the class
// tc is the object of MyFirstTestCase
// and instead of:
tc.dothis();
// ... I want to use:
dothis();
// dothis is a method of tc
你有沒有試着用的命名空間類似NameSpace.ClassName TC的名稱前綴的類名=新NameSpace.ClassName –
這是類''MyFirstTestCase? – Praveen