Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare a package named com.example.app.
Java
package [1];Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or dashes instead of dots in package names.
Including spaces in the package declaration.
✗ Incorrect
The package declaration uses dot notation without spaces or special characters.
2fill in blank
mediumComplete the code to import the class Utils from package com.example.utils.
Java
import [1].Utils;
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or dashes in import statements.
Adding spaces inside the import statement.
✗ Incorrect
Import statements use dot notation matching the package name.
3fill in blank
hardFix the error in the package declaration to follow Java syntax rules.
Java
package [1];Attempts:
3 left
💡 Hint
Common Mistakes
Using dashes or spaces in package names.
Using underscores instead of dots.
✗ Incorrect
Package names must use dots to separate identifiers without spaces or dashes.
4fill in blank
hardFill both blanks to create a class Helper inside package org.tools.
Java
package [1]; public class [2] { // class content }
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores in package names.
Starting class names with lowercase letters.
✗ Incorrect
Package names use dot notation; class names start with uppercase letters.
5fill in blank
hardFill all three blanks to declare package net.app.utils, import java.util.List, and define class DataHandler.
Java
package [1]; import [2]; public class [3] { // code here }
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores in package or import names.
Incorrect capitalization of class names.
✗ Incorrect
Package and import use dot notation; class names start with uppercase letters.
