What is the first line for, in the MainActivity.java?

82 Views Asked by At

package com.mycompany.myapp2;

I want to know what this does for my application.

I am a beginner. I'm trying to learn how to develop an android application. Thank you ❤️.

2

There are 2 best solutions below

0
Marcio Leal On

The line just inform to Java where you class is located in the project. It is called package, but if you browse your project, in case you are using eclipse or something like, it is just a folder.

0
DT.rw On

A package in Java is used to group related classes. Think of it as a folder in a file directory. We use packages to avoid name conflicts, and to write a better maintainable code. more details