Examlex

Solved

String Sentence; String Str1, Str2, Str3, Str4;

question 30

Multiple Choice

String sentence;
String str1, str2, str3, str4;
Int length1;sentence = "First exam is on Monday.";str1 = sentence.substring(6, 12) ;
Str2 = str1.substring(0, 4) ;
Str3 = sentence.replace('i', '#') ;
Str4 = sentence.indexOf("on") ;length1 = sentence.length() ;Based on the code above, what is the value of str4?


Definitions:

Cathode

An electrode through which electrons move outward from the source in an electrical device; in a battery, it's the negative electrode.

Voltaic

Pertaining to electricity or electrical phenomena, especially those produced chemically, e.g., in voltaic cells where chemical energy is converted into electrical energy.

Anode

An electrode through which conventional current flows into a polarized electrical device; in electrolysis, it is the positively charged electrode.

Battery

A device used to convert chemical energy into electric energy. A group of voltaic cells connected together in a series or parallel connection.

Related Questions