如果设treeView1=new TreeView(),TreeNode node=new TreeNode("根结点"),则treeView1.Nodes.Add(node)返回的是一个类型的值。()A、TreeNode;B、int;C、string;D、TreeView;

如果设treeView1=new TreeView(),TreeNode node=new TreeNode("根结点"),则treeView1.Nodes.Add(node)返回的是一个类型的值。()

  • A、TreeNode;
  • B、int;
  • C、string;
  • D、TreeView;

相关考题:

用VB或VB.NET或ASP.NET编程,从一个表中选出两个varchar列(其中一列数据不能有重复,并且长度等于4),并将两列连接成一个字符串,将这些字符串动态加载到TreeView1所有节点的Text属性中

winform TREEVIEW 与XML winform中如何动态添加一个节点?一般用什么判断点击了TREEVIEW节点后做出的相应行为事件,或者说switch()括号里应该放treeview哪个属性来做判断最好?

本题是一个Applet,它显示了一个树型结构。单击树结点的时候,就能将其子结点展开,同时下面的文本框可以显示出所单击的结点的路径,比如单击了根结点下B结点下B2结点,则文本框显示为"[TOP,B,B2]"。import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.tree.*;public class java2 extends JApplet{JTree tree;JTextField jtf;public void init(){Container cp=getContentPane();cp.setLayout(new BorderLayout());top=new DefaultMutableTreeNode("TOP"):DefaultMutableTreeNode a=new Default-MutableTreeNode("A");DefaultMutableTreeNode al = new Default-MutableTreeNode("Al");a.add(a1);DefatIltMutableTreeNode a2=new Default-MutableTreeNode("A2");a.add(a2);DefaultMutableTreeNode a3=new Default-MutableTreeNode("A3");a.add(a3);DefaultMutableTreeNode b=new Default-MutableTreeNode("B");DefaultMutableTreeNode bl=new Default-MutableTreeNode("Bl");b.add(b1);DefaultMutableTreeNode b2=new Default-MutableTreeNode("B2");b.add(b2);DefaultMutableTreeNode b3=new Default-MutableTreeNode("B3"):b.add(b3);top.add(a);top.add(b);tree=new JTree(top);int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;int h=ScrollPaneConstants.HORIZONTAL_SCRoLLBAR_AS_NEEDED;JScrollPane jsp=new JScrollPane(tree,V,h);cp.add(jsp,BorderLayout.CENTER);jtf=new JTextField(20);cp.add(jtf,BorderLayout.SOUTH);tree.addMouseListener(new MouseAdapter(){public void mouseClicked(MouseEvent me){doMouseClicked(me);}});}void doMouseClicked(MouseEvent me){tp=tree.getPathForLocation(me.getX(),me.getY());if(tp!=null)jtf.setText(tp.toString());elsejtf.setText("");}}

本题中定义了一个树型的通信录,窗El左侧是一个树,右侧是一个文本域,单击树的结点,则在右侧文本域中显示相关信息,如果单击的是树结点,则显示对应名字的电话信息。import javax.swing.*;import javax.swing.tree.*;import java.awt.*;import java.awt.event.*;import javax.swing.event.*;class Mytree2 extends JFrame{JTree tree=null;JTextArea text=new JTextArea(20,20);Mytree2(){Container con=getContentPane();DefauhMutableTreeNode root=new Default-MutableTreeNode("同学通信录");DefaultMutableTreeNode tl=new Default-MutableTreeNode("大学同学");DefaultMutableTreeNode t2=new Default-MutableTreeNode("研究生同学");DefaultMutableTreeNode tl l=new Default-MutatleTreeNode("陈艳");DefaultMutableTreeNode tl 2=new Default-MutableTreeNode("李小永");DefaultMutableTreeNode t2 1=new Defauh-MutableTreeNode("王小小");DefauhMutableTreeNode t2 2=new Defauh-MutableTreeNode("董小");setTitle("java2");root.add(t1);root.add(t2);tl.add(t1_1);tl.add(t1_2);t2.add(t2_1);t2.add(t2_2);tree=new JTree(root);JSerollPane scrollpane=new JScrollPane(text);JSplitPane splitpane=new JSplitPane(JSplitPane.HORIZONTAL SPLIT,true,tree,scrollpane);tree.addTreeSeleetionListener(this);con.add(splitpane);addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){System.exit(0);}});setVisible(true);setBounds(70,80,200,300);}public void valueChanged(TreeSelectionEvent e){if(e.getSouree()= =tree){DefauhMutableTreeNode node=(DefaultMutableTreeNode)tree.getLastSelected-PathComponent();if(node.isLeaf())(String str= ;if(str.equals("陈艳"))(text.setText(str+":联系电话:0411-4209876");}else if(str.equals("李小永")){text.setText(str+":联系电话:010-62789876");}else if(str.equals("王小小")){text.setText(str+":联系电话:0430-63596677");)else if(str.equals("董小")){text.setText(str+":联系电话:020-85192789");}}else{text.setText(node.getUserObject().toString());}}}}public class java2{public static void main(String args[]){Mytree2 win=new Mytree2();win.pack();}}

考虑如下代码:class Tree{}class Pine extends Tree{}class Oak extends Tree{}public class Forest {public static void main( String[] args ) {Tree tree = new Pine();if( tree instanceof Pine )System.out.println( "Pine" );if( tree instanceof Tree )System.out.println( "Tree" );if( tree instanceof Oak )System.out.println( "Oak" );elseSystem.out.println( "Oops" );}}则输出结果中有哪些?A.Pine B.Tree C.Forest D.Oops E.无输出

Draw a labeled constituent structure tree diagram for each of the following sentences: 1) The student likes the new linguistics professor. 2) John suggested Mary take the linguistics class.

Which two of these statements correctly describe classic PIM-SM?()A、The IOS default is for a last-hop router to trigger a switch to the shortest path tree as soon as a new source is detected on the shared tree.B、The IOS default is for every one of the routers on the shared tree to trigger a switch to the shortest path tree as soon as a new source is detected on the shared tree.C、The default behavior of switching to the shortest path tree as soon as a new source is detected on the shared tree can be disabled by setting the value in the ip pim spt-threshold command to "infinity."D、The default behavior of switching to the shortest path tree as soon as a new source is detected on the shared tree can be disabled by setting the value in the ip pim spt-threshold command to "zero."

treeView1.Nodes[1].Nodes[0]代表了控件treeView1的()。 A、第1个根节点的第1个子节点B、第1个根节点的第2个子节点C、第2个根节点的第1个子节点D、第2个根节点的第2个子节点

TreeView控件的节点集合保存在()属性之中。 A、ItemsB、NodesC、ControlsD、ImageList

The default behavior of switching to the shortest path tree as soon as a new source is detected on the shared tree can be disabled by setting the value in the ip pim spt-threshold command to "zero." ()A、loop guardB、storm controlC、storm suppressionD、broadcast suppressionE、BPDU guard

现有:  class Tree {  private static String tree = "tree ";  String getTree ()  {  return tree;  }       }  class Elm extends Tree {  private static String tree = "elm ";  public static void main (String  []  args)  {       new Elm() .go (new Tree())  ;      } }  void go (Tree t)  {  String  s =  t.getTree () +Elm.tree  +  tree  +   (new  Elm() .getTree ()) ;      System.out.println (s) ;}     结果为:()                 A、 elm elm elm elmB、 tree elm elm elmC、 tree elm elm treeD、 tree elm tree elm

如果设treeView1=newTreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。A、TreeNodeB、intC、stringD、TreeView

如果设treeView1=new TreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。A、TreeNodeB、intC、stringD、TreeView

final class Tree {  private static String tree = "tree ";  String getTree() { return tree; }  }  class Elm extends Tree {  private static String tree = "elm "; public static void main(String [] args) {  new Elm().go(new Tree());  }  void go(Tree t) {  String s = t.getTree()+Elm.tree+tree+(new Elm().getTree());  System.out.println(s);  } }  结果为:() A、elm elm elm elmB、tree elm elm elmC、tree elm tree elmD、编译失败

import java.io.*;  public class Forest implements Serializable {  private Tree tree = new Tree();  public static void main(String [] args) {  Forest f= new Forest();  try {  FileOutputStream fs = new FileOutputStream(”Forest.ser”);  ObjectOutputStream os = new ObjectOutputStream(fs);  os.writeObject(f); os.close();  } catch (Exception ex) { ex.printStackTrace(); }  }  }  class Tree { }  What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 An instance of Forest is serialized.D、 A instance of Forest and an instance of Tree are both serialized.

You create a Web Form that contains a TreeView control. The TreeView control allows users to navigate within the Marketing section of your Web site. The following XML defines the site map for your site. You need to bind the TreeView control to the site map data so that users can navigate only within the Marketing section. Which three actions should you perform?()A、Add a SiteMapDataSource control to the Web Form and bind the TreeView control to it.B、Add a SiteMapPath control to the Web Form and bind the TreeView control to it.C、Embed the site map XML within the SiteMap node of a Web.sitemap file.D、Embed the site map XML within the AppSettings node of a Web.config file.E、Set the StartingNodeUrl property of the SiteMapDataSource control to ~/Marketing.aspx.F、Set the SkipLinkText property of the SiteMapPath control to Sales.

You need to design a domain model that meets the company business and security requirements for controlling access to the new Web-based ordering application. What should you do?()A、Create a child OU within the existing domainB、Create a child domain of the existing domainC、Create a new domain in a new forest. Configure the new domain to trust the existing domainD、Create a new tree in the existing forest. Configure the new domain to trust the existing domain

单选题如果设treeView1=new TreeView(),TreeNode node=new TreeNode("根结点"),则treeView1.Nodes.Add(node)返回的是一个类型的值。()ATreeNode;Bint;Cstring;DTreeView;

单选题如果设treeView1=new TreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。ATreeNodeBintCstringDTreeView

单选题现有:  class Tree {  private static String tree = "tree ";  String getTree ()  {  return tree;  }       }  class Elm extends Tree {  private static String tree = "elm ";  public static void main (String  []  args)  {       new Elm() .go (new Tree())  ;      } }  void go (Tree t)  {  String  s =  t.getTree () +Elm.tree  +  tree  +   (new  Elm() .getTree ()) ;      System.out.println (s) ;}     结果为:()A elm elm elm elmB tree elm elm elmC tree elm elm treeD tree elm tree elm

单选题import java.io.*;  public class Forest implements Serializable {  private Tree tree = new Tree();  public static void main(String [] args) {  Forest f= new Forest();  try {  FileOutputStream fs = new FileOutputStream(”Forest.ser”);  ObjectOutputStream os = new ObjectOutputStream(fs);  os.writeObject(f); os.close();  } catch (Exception ex) { ex.printStackTrace(); }  }  }  class Tree { }  What is the result?()A Compilation fails.B An exception is thrown at runtime.C An instance of Forest is serialized.D A instance of Forest and an instance of Tree are both serialized.

多选题You create a Web Form that contains a TreeView control. The TreeView control allows users to navigate within the Marketing section of your Web site. The following XML defines the site map for your site. You need to bind the TreeView control to the site map data so that users can navigate only within the Marketing section. Which three actions should you perform?()AAdd a SiteMapDataSource control to the Web Form and bind the TreeView control to it.BAdd a SiteMapPath control to the Web Form and bind the TreeView control to it.CEmbed the site map XML within the SiteMap node of a Web.sitemap file.DEmbed the site map XML within the AppSettings node of a Web.config file.ESet the StartingNodeUrl property of the SiteMapDataSource control to ~/Marketing.aspx.FSet the SkipLinkText property of the SiteMapPath control to Sales.

单选题Which command enables RSTP on a switch?()Aspanning-tree mode rapid-pvstBspanning-tree uplinkfastCspanning-tree backbonefastDspanning-tree mode mst

单选题final class Tree {  private static String tree = "tree ";  String getTree() { return tree; }  }  class Elm extends Tree {  private static String tree = "elm "; public static void main(String [] args) {  new Elm().go(new Tree());  }  void go(Tree t) {  String s = t.getTree()+Elm.tree+tree+(new Elm().getTree());  System.out.println(s);  } }  结果为:()Aelm elm elm elmBtree elm elm elmCtree elm tree elmD编译失败

多选题The default behavior of switching to the shortest path tree as soon as a new source is detected on the shared tree can be disabled by setting the value in the ip pim spt-threshold command to "zero." ()Aloop guardBstorm controlCstorm suppressionDbroadcast suppressionEBPDU guard

单选题如果设treeView1=newTreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。ATreeNodeBintCstringDTreeView

单选题treeView1.Nodes[1].Nodes[0]代表了控件treeView1的()。A第1个根节点的第1个子节点B第1个根节点的第2个子节点C第2个根节点的第1个子节点D第2个根节点的第2个子节点