Showing posts with label set. Show all posts
Showing posts with label set. Show all posts

Saturday, 27 August 2016

Java 1.8 Concurrency feature "ConcurrentHashMap as a Set"

Java 1.8 Concurrency feature "ConcurrentHashMap as a Set"

The feature will return set of key in the map as Set.

public class VoiceConcurrentHashMap {

public static void main(String[] args) {

ConcurrentHashMap<String,String> map = new ConcurrentHashMap<String, String>();
System.out.println(map);
map.put("Lnkedin", "Networking");
map.put("Microsoft", "Windows10");
map.put("facebook", "Social");
map.put("Google", "SearchEngine");

KeySetView<String,String> set = map.keySet();
System.out.println(set);
}

}

Result : [Google, facebook, Microsoft, Lnkedin] .

Image :


ref :
Java API 


Thursday, 12 May 2016

fatal: remote origin already exists.

fatal: remote origin already exists.

git remote add origin https://github.com/voice/voiceApp.git

solution :

1.First remove origin
cmd :  git remote rm origin

2. now add the origin
cmd : git remote add origin https://github.com/voice/voiceApp.git

or

1.set the new git  origin/remote URL
.set the new origin
cmd : git remote set-url origin https://github.com/voice/voiceApp.git


2. Now check origin.

cmd : git remote show origin