网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
Which of the following statements about variables and their scopes are true? ()
A

Instance variables are member variables of a class.

B

Instance variables are declared with the static keyword.

C

Local variables defined inside a method are created when the method is executed.

D

Local variables must be initialized before they are used.


参考答案

参考解析
解析: 类中有几种变量,分别是:局部变量(英文可以为:local/automatic/temporary/stack variable)是定义在方法里的变量;实例变量(英文为:instance variable)是在方法外而在类声明内定义的变量,有时也叫成员变量;类变量(英文为:class variable)是用关键字static声明的实例变量,他们的生存期分别是:局部变量在定义该变量的方法被调用时被创建,而在该方法退出后被撤销;实例变量在使用new Xxxx()创建该类的实例时被创建,而其生存期和该类的实例对象的生存期相同;类变量在该类被加载时被创建,不一定要用new Xxxx()创建,所有该类的实例对象共享该类变量,其生存期是类的生存期。任何变量在使用前都必须初始化,但是需要指出的是局部变量必须显式初始化,而实例变量不必,原始类型的实例变量在该类的构造方法被调用时为它分配的缺省的值,整型是0,布尔型是false,而浮点型是0.0f,引用类型(类类型)的实例变量的缺省值是null(没有进行实际的初始化,对它的使用将引起NullPointException),类变量的规则和实例变量一样,不同的是类变量的初始化是在类被加载时。
更多 “多选题Which of the following statements about variables and their scopes are true? ()AInstance variables are member variables of a class.BInstance variables are declared with the static keyword.CLocal variables defined inside a method are created when the method is executed.DLocal variables must be initialized before they are used.” 相关考题
考题 Which of the following statements is NOT true about vagina? () A、It is a small sensory organ, which is located toward the front of the vulva where the folds of the labia joinB、It is a female’s external reproductive organC、It is a muscular, hollow tube that extends from the vaginal opening to the uterusD、It is shaped like an upside-down pear, with a thick lining and muscular walls

考题 Which of the following statements about Leopold and Rudolph Blaschka is TRUE?A. They were brothers.B. They were artists.C. They were florists.D. They were farmers.

考题 15 Which of the following statements about intangible assets are correct?1 If certain criteria are met, research expenditure must be recognised as an intangible asset.2 Goodwill may not be revalued upwards.3 Internally generated goodwill should not be capitalised.A 2 and 3 onlyB 1 and 3 onlyC 1 and 2 onlyD All three statements are correct

考题 Which of the following statements about testing software with data is (are) true?Ⅰ.The primary purpose of such testing is to find errors.Ⅱ.Such testing can demonstrate the existence of errors but cannot demonstrate the absence of errors.A.NeitherB.I onlyC.ⅡonlyD.Ⅰand Ⅱ

考题 In the following statements about functional dependency, which one is incorrect?A.Ifthen X→X'.B.If X→Y andthen X→Y'.C.If X→Y andthen X'→Y.D.If X→Y and Y→Z, then X→Z.

考题 19 Which of the following statements about intangible assets in company financial statements are correct accordingto international accounting standards?1 Internally generated goodwill should not be capitalised.2 Purchased goodwill should normally be amortised through the income statement.3 Development expenditure must be capitalised if certain conditions are met.A 1 and 3 onlyB 1 and 2 onlyC 2 and 3 onlyD All three statements are correct

考题 Which of the following statements about ORACLE is (are) correct?Ⅰ.ORACLE follows SQL standardⅡ.ORACLE database defines two logical types: table and viewA.ⅠonlyB.Ⅱ onlyC.Ⅰ and ⅡD.none of the above

考题 Which of the following statements are true of collectivist culture? A、Disclosure of private feeling is distasteful.B、People are suspicious of outsiders.C、Uniformity is not highly thought of.D、there is a positive attitude about words of disagreement.

考题 which of the following statements is not true about the british media?A. They are mainly interested in making huge profits by publishing advertisements.B. They supply people with news,keeping them informed of what is happening in the world.C. They help shape British culture.D. They provide entertainment.

考题 Which of the following statements about The Scarlet Letter is NOT true? A.It explores man's never-ending search for the satisfaction of materialistic desires.B.It relates the conflicts between the society and the individual.C.It is about the effect of sin on the people involved and the society as a whole.D.It presents a p

考题 Which of following statements about testing software with data is (are) true?Ⅰ.The primary purpose of such testing is to find errors.Ⅱ.Such testing can demonstrate the existence of errors but can not demonstrate the absence of errors.A.NeitherB.Ⅰ onlyC.Ⅱ onlyD.Ⅰ and Ⅱ

考题 Which of the following statements about language is NOT true?A.Language is a system B.Language is symbol C.Animals also have language D.Language is arbitrary

考题 Which of the following statements about California is NOT TRUE?( ) A.California is a sexually liberated state. B.California has a high abortion rate. C.About 40% of the pregnant teenagers chose to have an abortion. D.A recent poll showed that less than half of the respondents supported the amendment.

考题 Which of the following statements is true about a router's eBGP peers that is not also true about that same router's iBGP peers?()A、The eBGP peer neighborship uses TCPB、The eBGP peer uses port 180 (default)C、The eBGP peer uses the same ASN as the local routerD、The eBGP peer updates its AS_Path PA before sending updates to this router

考题 Which ONE of the following statements about Domino Enterprise server is true?()A、Can host Active Server Pages Web sitesB、Can host PHP Web sitesC、Includes a DB2 serverD、Includes an integrated Web application server

考题 Krstin has created a page in the videos application .which one of the following statements about pages is not true ?()A、pages are design elementsB、Pages can be full-text indexed C、pages  can be referenced by outlines or frames  D、pages  can include text,graphics ,applets,and links

考题 Which of the following statements about variables and scope are true?() A、 Local variables defined inside a method are destroyed when the method is exited.B、 Local variables are also called automatic variables.C、 Variables defined outside a method are created when the object is constructed.D、 A method parameter variable continues to exist for as long as the object is needed in which the method is defined.

考题 单选题Which of the following statements about the golf club is NOT true?A It’s at the top of the cliff.B They were not allowed to be in the club.C They parked the car near the club.

考题 单选题Which of the following statements is NOT true about the postal service?A American abortionists were not happy about it.B The stamp was invented in Britain.C It helped the independence of America.D In the 1840s it was the major means of national communications in Britain.

考题 多选题Which of the following statements about variables and scope are true?()ALocal variables defined inside a method are destroyed when the method is exited.BLocal variables are also called automatic variables.CVariables defined outside a method are created when the object is constructed.DA method parameter variable continues to exist for as long as the object is needed in which the method is defined.

考题 单选题Which of the following statements about task design is incorrect?A Activities must have clear and attainable objectives.B Activities should be confined to the classroom context.C Activities must be relevant to students' life experiences.D Activities should help develop students' language ability.

考题 单选题According to the passage, which of the following statements about the cell phone service at Yellowstone is TRUE?A It is limited to certain areas in the park.B It is available everywhere in the park.C It is not available in the park.D It is available to visitors at a fee.

考题 单选题Which of the following statements about general cargoes is not correct?()A General cargoes are neither liquid nor solid bulk cargoB General cargoes are packaged hazardous cargoesC General cargoes are also called breakbulk cargoesD General cargoes are mostly carried on container ships now

考题 单选题Which of the following statements is true?A Scientists have solved the mystery about the fish killer.B More studies need to be made about the fish killer.C It is proved that the algae are reducing fish populations.D Humans have already been affected by the toxin.

考题 单选题Which of the following statements is NOT true about mass communication?A It can reach no further than human voice.B It can reach a large audience.C It is rapid and efficient.D It can be trusted.

考题 单选题Which of the following environment variables specifies a non-default location for the listener configuration file?()A LSN_ADMINB TNS_ADMINC ADMIN_TNSD TSN_ADMIN

考题 单选题Which of the following statements about a lesson plan is inappropriate?A It is a teaching guideB It is a blueprint to be strictly followedC It takes into account syllabus and studentsD It describes in advance what and how to teach