Java Java Data Structures Getting There Packages

Aiden Asprakis
Aiden Asprakis
1,078 Points

what does this chalenge want me to do <Let's create some code for the Example company. They own the domain example.com.>

Let's create some code for the Example company. They own the domain example.com. Place the BlogPost.java file in the proper package by using the package keyword.

Where and what is the proper package

com/example/BlogPost.java

Display.java
public class Display {

  public static void main(String[] args) {
    // Your code here...

  }
}

1 Answer

Florian Stegemann
Florian Stegemann
Full Stack JavaScript Techdegree Student 22,659 Points

They want you to declare that BlogPost.java is part of a package. Package names correspond to the folder structure of a project and to guarantee that a package name is unique, they are usually based on domain names in reversed order.

For a domain like teamtreehouse.com the folder structure would look like com/teamtreehouse/Class.java and the package would be declared as seen in the snippet below:

package com.teamtreehouse;