Skip to content
Quiz · Ownership · lesson 6 of 8

Quiz — a clone is independent

What does the program print?

Rust
fn main() {
    let mut s1 = String::from("hi");
    let s2 = s1.clone();
    s1.push('!');
    println!("{s1} {s2}");
}