Skip to content

Commit 7b371cf

Browse files
author
Araf Karsh Hamid
committed
Minor Updates
1 parent 53da089 commit 7b371cf

3 files changed

Lines changed: 49 additions & 5 deletions

File tree

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
| Java SE 7 | Jul 2011 | Project Coin (Diamond Operator, Strings in Switch), NIO.2 |
1111
| Java SE 8 LTS | Mar 2014 | Functional Programming, Lambda & Streams, Multiple Inheritance |
1212
| Java SE 9 | Sep 2017 | Modularization - Java Platform Module System |
13-
| Java SE 10 | Mar 2018 | Local Variable Type Inference |
13+
| Java SE 10 | Mar 2018 | Local Variable Type Inference, List / Set / Map - CopyOf |
1414
| Java SE 11 LTS | Sep 2018 | New HTTP Client API, Nest-based access control, Remove JavaFX |
1515
| Java SE 12 | Mar 2019 | Switch Expressions (Preview) |
1616
| Java SE 13 | Sep 2019 | Text Blocks (Preview) |

src/java10/CopyOfExample.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* Java 10 Examples
35-
* List CopyOf
35+
* List CopyOf - Returns Immutable Collection
3636
*
3737
* @author: Araf Karsh Hamid
3838
* @version:
@@ -43,9 +43,10 @@ public class CopyOfExample {
4343
public static void main (String[] args) {
4444
List<String> cities = buildCities();
4545
addNewCity(cities, "Mumbai");
46-
47-
List<String> copyOfCities = List.copyOf(cities);
48-
addNewCity(copyOfCities, "Lucknow");
46+
// List CopyOf - Returns Immutable Collection
47+
// Constraints - Collection Must not have Nullable Value
48+
List<String> immutableCities = List.copyOf(cities);
49+
addNewCity(immutableCities, "Lucknow");
4950
}
5051

5152
public static void addNewCity(List<String> cities, String city) {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* Copyright (c) 2024 Araf Karsh Hamid
3+
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17+
* THE SOFTWARE.
18+
19+
* This program and the accompanying materials are dual-licensed under
20+
* either the terms of the Eclipse Public License v1.0 as published by
21+
* the Eclipse Foundation
22+
23+
* or (per the licensee's choosing)
24+
25+
* under the terms of the Apache 2 License version 2.0
26+
* as published by the Apache Software Foundation.
27+
*/
28+
package java11;
29+
30+
/**
31+
* Java 11 Example
32+
* File Read Write
33+
*
34+
* @author: Araf Karsh Hamid
35+
* @version:
36+
* @date:
37+
*/
38+
public class FileReadWriteExample {
39+
40+
public static void main (String[] args) {
41+
42+
}
43+
}

0 commit comments

Comments
 (0)