Iftad Abser
Iftad Abser

Reputation: 1

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

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 ❤️.

Upvotes: -3

Views: 87

Answers (2)

DT.rw
DT.rw

Reputation: 11

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

Upvotes: 1

Marcio Leal
Marcio Leal

Reputation: 11

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.

Upvotes: 1

Related Questions