0
0
Javaprogramming~15 mins

Creating packages in Java - Interactive Practice

Choose your learning style8 modes available
ads_clickPractice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare a package named com.example.app.

Java
package [1];
🎯 Drag options to blanks, or click blank then click option
Acom example app
Bcom_example_app
Ccom-example-app
Dcom.example.app
Attempts:
3 left
2fill in blank
medium

Complete the code to import the class Utils from package com.example.utils.

Java
import [1].Utils;
🎯 Drag options to blanks, or click blank then click option
Acom.example.utils
Bcom_example_utils
Ccom-example-utils
Dcom example utils
Attempts:
3 left
3fill in blank
hard

Fix the error in the package declaration to follow Java syntax rules.

Java
package [1];
🎯 Drag options to blanks, or click blank then click option
Acom.example.app
Bcom-example-app
Ccom_example_app
Dcom example app
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a class Helper inside package org.tools.

Java
package [1];

public class [2] {
    // class content
}
🎯 Drag options to blanks, or click blank then click option
Aorg.tools
BHelper
Chelper
Dorg_tools
Attempts:
3 left
5fill in blank
hard

Fill 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
}
🎯 Drag options to blanks, or click blank then click option
Anet.app.utils
Bjava.util.List
CDataHandler
Dnet_app_utils
Attempts:
3 left