Q. What is the correct way to check if a string starts with a specific prefix in Java? (A) str.startsWith(prefix) (B) str.beginsWith(prefix) (C) str.starts(prefix) (D) str.hasPrefix(prefix) ποΈ Show Answer π¬ Discuss π Share β‘Menu β Correct Answer: (A) str.startsWith(prefix)