String s="one two three";
int pos=s.indexOf('t');
int pos1=s.indexOf('t',7);
System.out.println(pos+""+pos1);
Answers
Answered by
1
Answer:
With a percent 3 the a later days later 48 a the 3 later a 6 days 38 the 3 of chef Asia 2 2 and the and later I 6 and the and later I 6 and in I minutes from Africa days later 48 a percent days 60 the from of days Asia the in later minutes a Africa 3 the a later 3 a chef days get the question of Africa Asia the d of e and I I from from days days the the of of Asia Asia in d minutes e the d later 3
Answered by
2
Question:-
- Write the output of the following code.
Solution:-
Given code,
String s="one two three";
int pos=s.indexOf('t');
int pos1=s.indexOf('t',7);
System.out.println(pos+""+pos1);
pos=4 (first index of t is 4)
pos1=8(first index of t after 7th index is 8)
Output:-
48
Similar questions
Geography,
3 months ago
Geography,
3 months ago
Computer Science,
7 months ago
Geography,
11 months ago