सिक्योरिटी जाँच
आप यह सुनिश्चित करना चाहते हैं कि जिस साइट पर आप जाना चाहते हैं वह सुरक्षित है। सभी वेबसाइटें जो सुरक्षित होती हैं, वे https:// से शुरू होती हैं। जो सुरक्षित नहीं हैं वे http:// से शुरू होती हैं (ध्यान दें, यहाँ s नहीं है)।
यह अभ्यास पाठ्यक्रम का हिस्सा है
इंटरमीडिएट Java
अभ्यास निर्देश
urlस्ट्रिंग में character's'का सही index वैरिएबलcharPositionको असाइन करें.- उसी पोज़िशन का character निकालने के लिए
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));
}
}