initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
## Getting Started
|
||||
|
||||
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
|
||||
|
||||
## Folder Structure
|
||||
|
||||
The workspace contains two folders by default, where:
|
||||
|
||||
- `src`: the folder to maintain sources
|
||||
- `lib`: the folder to maintain dependencies
|
||||
|
||||
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
|
||||
|
||||
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
|
||||
|
||||
## Dependency Management
|
||||
|
||||
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class App {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
Ville villeParDefaut = new Ville();
|
||||
Ville paris = new Ville("Paris", 123456, "France");
|
||||
Ville marseille = new Ville("Marseille", 654321, "France");
|
||||
|
||||
System.out.println(villeParDefaut.getNomVille());
|
||||
System.out.println(paris.getNomVille());
|
||||
System.out.println(marseille.getNomVille());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
public class Ville {
|
||||
|
||||
private String nomVille;
|
||||
private String nomPays;
|
||||
private int nbreHabitants;
|
||||
|
||||
public Ville(){
|
||||
|
||||
System.out.println("Création d'une ville");
|
||||
nomVille= "toto";
|
||||
nomPays = "tata";
|
||||
nbreHabitants= 0;
|
||||
|
||||
}
|
||||
|
||||
public Ville(String pNom, int pNbre, String pPays){
|
||||
System.out.println("Création d'une ville");
|
||||
nomVille= pNom;
|
||||
nomPays = pPays;
|
||||
nbreHabitants= pNbre;
|
||||
}
|
||||
|
||||
public int getNbreHabitants() {
|
||||
return nbreHabitants;
|
||||
}
|
||||
|
||||
public String getNomPays() {
|
||||
return nomPays;
|
||||
}
|
||||
|
||||
public String getNomVille() {
|
||||
return nomVille;
|
||||
}
|
||||
|
||||
public void setNbreHabitants(int nbreHabitants) {
|
||||
this.nbreHabitants = nbreHabitants;
|
||||
}
|
||||
|
||||
public void setNomPays(String nomPays) {
|
||||
this.nomPays = nomPays;
|
||||
}
|
||||
|
||||
public void setNomVille(String nomVille) {
|
||||
this.nomVille = nomVille;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user