私の質問は: "classA"から呼び出されたときに "classA"内の特定のフィールドを検索する静的クラス "classB"に静的メソッド "meth1"を定義できますか?定義されているクラスではない)? 私はより良い説明しよう:私はこのような何かを実行する必要があります。 public class classA
{
string someText;
int anInt;
public class bioscope extends Component{
static int width;
static int height;
public void paint(Graphics g){
try {
BufferedImage crow = ImageIO.read(new File("photos/houseCrow.jpg"));
NHMountainGoatのおかげで答えが得られました! インタフェースを実装するのが良い選択肢に見えるので、「必要な」メソッドのみがインスタンス化されています。 それは次のようになります。 EDIT class Machine
{
//REM: MachineConnexion is a link to the main server where asking the data
は、次のように私はC#のシングルトンクラスを持っていると言う: using System.Collections.Generic;
public sealed class RestrictedNameCollection : List<string>
{
private static object _lock = new object();
private Restri