首页/ 题库 / [多选题]Which are syntactica的答案

Which are syntactically valid statement at// point x?()     class Person {     private int a;  public int change(int m){  return m;  }     }  public class Teacher extends Person {     public int b;  public static void main(String arg[]){     Person p = new Person();     Teacher t = new Teacher();    int i;  // point x     }    } 

多选题
2022-10-08 14:36
A、 i = m;
B、 i = b;
C、 i = p.a;
D、 i = p.change(30);
E、 i = t.b.
查看答案

正确答案
D | E

试题解析
A:m没有被申明过,不能使用。 
B:虽然b是类Teacher的public成员变量,但是在静态方法中不能使用类中的非静态成员。 
C://a是类Person的private成员,在类外不能直接引用。 
D://change(int m)方法是public方法,并且返回一个int型值,可以通过类的实例变量p引用并赋值给一个int型变量。 
E://b是类Teacher的public成员变量,且是int型,可以通过类的实例变量t引用并赋值给一个int型变量

标签: CMS专题
感兴趣题目
Which three statements about subqueries are true? ()
Which two are valid IS-IS PDU types?()
Which of the following are valid methods of providing a router with information concerning the location of the RP()
Which three statements are true about a registration server in a community?() (Choose three.)
Evaluate this SQL statement: In the statement, which capabilities of a SELECT statement are performed?()
Flex Links are a pair of a Layer 2 interfaces (switchports or port channels), where one interface is configured to act as a backup to the other. Which two statements are correct regarding Flex Links?()
Which are syntactically valid statement at// point x?()     class Person {     private int a;  public int change(int m){  return m;  }     }  public class Teacher extends Person {     public int b;  public static void main(String arg[]){     Person p = new Person();     Teacher t = new Teacher();    int i;  // point x     }    } 
Which three options are valid WAN connectivity methods?()
Which two options are valid WAN connectivity methods?()
Which three statements are true about using flashback database in a multitenant container database(CDB)?()
Which statement is true regarding the VALIDATE DATABASE command?()
Which two statements are true about the RMAN validate database command?()
相关题目
Which of the following are valid program types for a lightweight job?()
Which four are valid Oracle constraint types? ()
Which two statements are true about a job chain?()
Which three statements are true?()
Which two statements are true about a job chain? ()(Choose two.)
Which two statements are true?()
Which two statements are true about a Work Item with "Open" Notification? ()(Choose two.)
Which statement correctly describes a situation in which VRFs are used in the data center?()
Which two statements about the use of VLANs to segment a network are true?()
Which three message types are valid PIMv2 message types?()
Generally speaking, the syntactic relations include three basic types.Which of the following is NOT a type of syntactic relations?
Generally speaking, the syntactic relations include three basic types. Which of the following is NOT a type of syntactic relations?
Which of the following statement(s)is/are FALSE regarding a twin pedestal crane set ().
Which of the following statement(s)is/are TRUE regarding a twin pedestal crane set().
Which is a valid CREATE TABLE statement? ()
Which three statements correctly describe the Cisco Validated Designs program? ()(Choose three.)
Which two statements are true about the security-related tags in a valid Java EE deployment descriptor?()
Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo()method, which two statements are true?()
Which three statements about subqueries are true?()
Which three statements about subqueries are true? ()
广告位招租WX:84302438

免费的网站请分享给朋友吧