To access the last character of a string class object str you can use the expression

A) str[last].
B) str.last().
C) str[str.length()].
D) str[str.length()-1].
E) None of the above

D) str[str.length()-1].

Computer Science & Information Technology

You might also like to view...

A security analyst discovers accounts in sensitive SaaS-based systems are not being removed in a timely manner when an employee leaves the organization. To BEST resolve the issue, the organization should implement:

A. federated authentication. B. role-based access control. C. manual account reviews D. multifactor authentication.

Computer Science & Information Technology

What is the output of the following program segment?

``` Dim temp() As String = IO.File.ReadAllLines('Data.txt") Dim n As Integer = temp.Count - 1 Dim numbers(n) As Double, h As Double = 0 For i As Integer = 0 To n numbers(i) = CDbl(temp(i)) Next For k As Integer = 0 to n h += numbers(k) Next txtBox.Text = CStr(h) ``` Assume the four rows of the file Data.txt contain the following entries: 2, 4, 2, 3 (A) 11 (B) 2 (C) 7 (D) 4

Computer Science & Information Technology