Home » Microsoft » MB6-704 » Which code segment should you insert at line 10?
You have a class named Class l that contains a static method named smethodl and an instance method named method2.
Class l contains the following X+ + code: (Line numbers are included for reference only.)
You need to call smethodl from method2.
Which code segment should you insert at line 10?
A. Class l.smethodl()
B. Class l::smethod l ()
C. This::smethodl()
D. This.smthod l()
Correct Answer: B
Explanation/Reference:
Calling a Static Method
In the following example, there is no need to first construct an instance of the SoftwareKey class before you call a static method on the class. To call the static method validateSoftwareKey, the syntax starts with the name of the class that contains the method. A pair of colon (::) characters is used to connect the class name to the static method name. boolean yourBool = SoftwareKey::validateSoftwareKey(yourSoftwareKeyString);
Reference: Static Methods [AX 2012]