forked from Labore/PR2-L
add BifunctionDemo
parent
4d0db08a3c
commit
6a276dba76
|
|
@ -4,6 +4,13 @@
|
|||
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "BiFunctionDemo",
|
||||
"request": "launch",
|
||||
"mainClass": "BiFunctionDemo",
|
||||
"projectName": "PR2-L_232be59f"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "CollectionsDemo",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
||||
|
|
@ -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).
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import java.util.function.BiFunction;
|
||||
|
||||
public class BiFunctionDemo {
|
||||
public static void main(String args[])
|
||||
{
|
||||
BiFunction<Integer, Integer, Integer> composite1 = (a, b) -> a + b;
|
||||
|
||||
composite1 = composite1.andThen(a -> 2 * a);
|
||||
|
||||
System.out.println("Composite1 = " + composite1.apply(2, 3));
|
||||
|
||||
BiFunction<Integer, Integer, Integer> composite2 = (a, b) -> a * b;
|
||||
|
||||
composite2 = composite2.andThen(a -> 3 * a);
|
||||
|
||||
System.out.println("Composite2 = " + composite2.apply(2, 3));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue