시작하기무료로 시작하기

보안 확인

방문하려는 사이트가 안전한지 확인하려고 합니다. 보안을 사용하는 모든 웹사이트는 https://로 시작합니다. 그렇지 않은 경우 http://로 시작합니다(s가 없는 점에 주의하세요).

이 연습은 강의의 일부입니다

중급 Java

강의 보기

연습 안내

  • 문자열 url에서 문자 's'의 올바른 인덱스를 변수 charPosition에 할당하세요.
  • 해당 위치의 문자를 추출해 출력하도록 url 문자열에 알맞은 String 메서드를 사용하세요.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

class SecurityChecker {
  public static void main(String[] args) {
    String url = "https://www.datacamp.com";
    // Enter the right position to retrieve the 's' of the above url
    int charPosition = ____;

    System.out.println("s means secure : ");
    // Enter the correct method on url to find the security character
    System.out.println(url.____(charPosition));
  }
}
코드 편집 및 실행