以下の2つの方法のうち、オブジェクトの変換にはどのような方法が適していますか?コンストラクタ public class Foo {
int foo;
}
class Bar {
int bar;
public Bar(int bar) {
this.bar = bar;
}
public Bar(Foo foo) {
t
public interface IDoSomething
public class ClassA : IDoSomething
public class ClassB : IDoSomething
public class ClassC : IDoSomething
いくつかのクラスによって実装されたインターフェイスがあります。また、一部のデータを解析してからこれらのオブジェクトの新
は、私は私のコードで以下のメソッドを持っていると言う: public bool RemoveItem(Item item)
{
// Logic to remove a single item
}
public bool RemoveItems(List<Item> items)
{
// Logic for removing multiple items. Runn
私は何かについて疑問に思っていました。私は誰かが私のために明確にできることを望んでいました。 たちはクラスのベストプラクティスを行うにはどうなるか今 class Test
{
private $value;
function first()
{
if("this"=="that") {
$neededVariable = 1;