Skip to content

Instantly share code, notes, and snippets.

View kunals201's full-sized avatar

Kunal sethi kunals201

View GitHub Profile
@kunals201
kunals201 / sample1.java
Created March 9, 2018 08:21
No _ example
public class Sample {
public static void main(String[] args) {
int _ = 4;
System.out.println(_);
}
}
@kunals201
kunals201 / sample.java
Created March 9, 2018 07:28
Java9 interface private methods example
interface Util {
default int numberOfStudents() {
return helper();
}
private int helper() {
return 10;
}
@kunals201
kunals201 / CountWords.java
Created January 31, 2018 05:40
Number of Words count
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Stream;
public class WordCount {
public static void main(String[] args) throws IOException {
countWords("sample.txt");
@kunals201
kunals201 / WordCounts.java
Created January 31, 2018 05:19
This program count the number of words
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Stream;
public class WordCount {
public static void main(String[] args) throws FileNotFoundException {
countWords("sample.txt");
}
@kunals201
kunals201 / WordCount.java
Last active January 31, 2018 05:37
testing the gist for blog
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Stream;
public class WordCount {
public static void main(String[] args) throws FileNotFoundException {
countWords("sample.txt");
}