我有这个代码。如何获得public class Animal {
// insert code here
}
public class Dog extends Animal {
// insert code here
}
public class Cat extends Animal {
// insert code here
}
public class test {
Animal animal = new Animal();
// how do I get the name of the subclass i.e. how to get that the
// animal is a dog if it is in fact a dog??!
}
的{{1}}:
'a'
感谢您的帮助。刚开始学习JavaScript。
答案 0 :(得分:4)
这应该这样做:
#div
id="div1"
是these instructions; >
将元素与.
.a
是ID selector class="a"
是child selector; <div class="a">
匹配<div id="div1">
这一起,它专门选择 private void SaveFile()
{
XmlDocument doc = new XmlDocument();
doc.Load("C:\\Test.xml");
XmlNode Buses = doc.SelectSingleNode("//Buses");
XmlNode oldPlateNumber = doc.SelectSingleNode("//YES-6548");
XmlElement PlateNumber = doc.CreateElement("DUS-456");
XmlElement VIN = doc.CreateElement("VIN");
VIN.InnerText = textBox1.Text;
if (oldPlateNumber != null)
{
Buses.ReplaceChild(PlateNumber, oldPlateNumber);
doc.Save("C:\\Test.xml");
}
else
{
PlateNumber.AppendChild(VIN);
Buses.AppendChild(PlateNumber);
doc.Save("C:\\Test.xml");
}
}
的子Sub SetVar(NAME As String, VALUE As Variant)
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swEqnMgr = swModel.GetEquationMgr
For i = 0 To swEqnMgr.GetCount - 1
vSplit = Split(swEqnMgr.Equation(i), " = ")
vSplit(0) = Replace(vSplit(0), Chr(34), Empty)
If vSplit(0) = NAME Then _
swEqnMgr.Equation(i) = Replace(swEqnMgr.Equation(i), vSplit(1), VALUE)
Next i
End Sub
元素。