Commit ddc8fece authored by james.langley's avatar james.langley

commit

parents
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
## 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).
import java.util.Scanner;
import java.util.ArrayList;
public class App {
public static void main(String[] args) {
ArrayList<String> Animals = new ArrayList<String>();
Animals.add("Lion");
Animals.add("Tiger");
Animals.add("Jaguar");
Animals.add("Polar Bear");
Animals.add("Owl");
Animals.add("Toucon");
Animals.add("Gold Fish");
Animals.add("Shark");
Animals.add("Black Momba");
Animals.add("Tortois");
System.out.println(Animals);
Scanner myObj = new Scanner(System.in);
String Animal;
System.out.println("Which Animal do you want to know more about?");
Animal = myObj.nextLine();
if (Animal == Animal){
System.out.println(public class Animal)
}
}
}
public class Lion {
String name;
String Food;
String Habitat;
}
Lion lionA = new Lion();
lionA.name = "Lion";
lionA.Food = "meat";
lionA.Habitat = "African Plains";
public class Tiger {
String name;
String Food;
String Habitat;
}
Tiger tigerA = new Tiger();
tigerA.name = "Tiger";
tigerA.Food = "meat";
tigerA.Habitat = "Jungle";
public class Jaguar extends Tiger {
Jaguar jaguarA = new Jaguar();
jaguarA.name = "Jaguar";
jaguarA.Food = "Meat";
jaguarA.Habitat = "Jungle";
}
public class Polar_Bear {
String name;
String Food;
String Habitat;
}
Polar_Bear polar_bear = new Polar_Bear();
polar_bear.name = "Polar Bear";
polar_bear.Food = "Fish";
polar_bear.Habitat = "Arctic"
public class Owl{
String name;
String Food;
String Habitat;
}
Owl owlA = new Owl();
owlA.name = "Owl";
owlA.Food = "Mice";
owlA.Habitat = "Woods";
public class Toucan{
String name;
String Food;
String Habitat;
}
Toucan toucanA = new Toucan();
toucanA.name = "Toucan";
toucanA.Food = "Bugs";
toucanA.Habitat = "Jungle";
public class Gold_Fish{
String name;
String Food;
String Habitat;
}
Gold_Fish gold_fish = new Gold_Fish();
gold_fish.name = "Gold Fish";
gold_fish.Food = "plants";
gold_fish.habitat = "Ocean";
public class Shark{
String name;
String Food;
String Habitat;
}
Shark sharkA = new Shark();
sharkA.name = "Shark";
sharkA.Food = "Fish";
sharkA.habitat = "Ocean";
public class Black_Momba{
String name;
String Food;
String Habitat;
}
Black_Momba black_momba = new Black_Momba();
black_momba.name = "Black Momba";
black_momba.Food = "Small Mammals";
black_momba.Habitat = "Open Woodlands";
public class Tortoise{
String name;
String Food;
String Habitat;
}
Tortoise tortoiseA = new Tortoise();
tortoiseA.name = "Tortoise";
tortoiseA.Food = "vegtables";
tortoiseA.Habitat = "Grasslands";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment