Commit 44f1ad79 authored by adam.buttle's avatar adam.buttle

Escape

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).
public class App {
public static void main(String[] args) throws Exception {
int fingersOnRightHand = 6; // Ex 4.1 / 4.4
if (fingersOnRightHand == 6) { // Ex 4.2
String greetingString = "Hello"; // Ex 1.6 / 1.7
String introductionString = "My name is Inigo Montoya"; // Ex 1.8
String reminderString = "You killed my father!"; // Ex 1.9
String threatString = "Prepare to die!"; // Ex 1.10
System.out.println(greetingString + ", " + introductionString + ", " + reminderString + ", " + threatString); // Ex 1.11
}
else { // Ex 4.5
System.out.println("I am searching for the man who killed my father.");
}
int daysPerWeek = 7; // Ex 1.1
int numberOfWeeks = 6; // Ex 1.2
int totalDays = daysPerWeek * numberOfWeeks; // Ex 1.3
System.out.println(totalDays);
Boolean onHoliday = false; // Ex 1.4
System.out.println( onHoliday );
Double approxPI = 3.14; // Ex 1.5
System.out.println(approxPI * 3);
for (int loopCounter = 1; loopCounter < 14; loopCounter++) // Ex 6.1 / 2 / 3
{
int month = loopCounter; // Ex 5.1
switch (month){ // Ex 5.2
case 1: System.out.println("January");
break;
case 2: System.out.println("Febuary");
break;
case 3: System.out.println("March");
break;
case 4: System.out.println("April");
break;
case 5: System.out.println("May");
break;
case 6: System.out.println("June");
break;
case 7: System.out.println("July");
break;
case 8: System.out.println("August");
break;
case 9: System.out.println("September");
break;
case 10: System.out.println("October");
break;
case 11: System.out.println("November");
break;
case 12: System.out.println("December");
break;
default: System.out.println("Not a valid month");
}
}
int index = 1;
while(index < 14);
{
}
}
}
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