Skip to content

Commit eff8878

Browse files
committed
Update Readme
1 parent 7f0a908 commit eff8878

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,13 @@ The javadoc for the last release is available [here](http://www.javadoc.io/doc/o
5353
Create a workbook with a single worksheet and a few cells with the different supported data types.
5454

5555
```java
56-
try (OutputStream os = ...) {
57-
Workbook wb = new Workbook(os, "MyApplication", "1.0");
56+
try (OutputStream os = ..., Workbook wb = new Workbook(os, "MyApplication", "1.0");) {
5857
Worksheet ws = wb.newWorksheet("Sheet 1");
5958
ws.value(0, 0, "This is a string in A1");
6059
ws.value(0, 1, new Date());
6160
ws.value(0, 2, 1234);
6261
ws.value(0, 3, 123456L);
6362
ws.value(0, 4, 1.234);
64-
wb.finish();
6563
}
6664
```
6765

@@ -277,8 +275,7 @@ ws.fitToHeight(999);
277275

278276
Each worksheet is generated by a different thread.
279277
```java
280-
try (OutputStream os = ...) {
281-
Workbook wb = new Workbook(os, "MyApplication", "1.0");
278+
try (OutputStream os = ...; Workbook wb = new Workbook(os, "MyApplication", "1.0");) {
282279
Worksheet ws1 = wb.newWorksheet("Sheet 1");
283280
Worksheet ws2 = wb.newWorksheet("Sheet 2");
284281
CompletableFuture<Void> cf1 = CompletableFuture.runAsync(() -> {
@@ -290,7 +287,6 @@ try (OutputStream os = ...) {
290287
...
291288
});
292289
CompletableFuture.allOf(cf1, cf2).get();
293-
wb.finish();
294290
}
295291
```
296292

0 commit comments

Comments
 (0)