Java Coding Practice
Practice typing real code syntax, including brackets, punctuation, and indentation. Snippets are for typing practice only and are never executed.
Methods and strings
Type the code exactly. Tab inserts four spaces. Code is not executed.
Progress: 0%
Current mismatches: 0
public class Greeting {
static String greet(String name) {
return "Hello, " + name.trim() + "!";
}
public static void main(String[] args) {
System.out.println(greet("Ada"));
}
}
Type the code exactly, including spaces and indentation.