JAVA
2.7K subscribers
73 photos
111 files
76 links
Download Telegram
import java.util.Hashtable;
import java.util.Map;
public class Program
{
public static void main(String[] args) {
Map<Integer,String> hashtable=new Hashtable<Integer,String>();
hashtable.put(11,"a");
hashtable.put(null,"c");
hashtable.put(null,null);
System.out.println(hashtable.size());
System.out.println(hashtable);
}
}
import java.util.HashMap;
class Employee{
private String name;
public Employee(String name){
this.name=name;
}
public int hashCode(){
return 1;
}
}
public class Program
{
public static void main(String[] args) {
HashMap<Employee,String> hashMap=new HashMap<Employee,String>();
hashMap.put(new Employee("a"),"emp1");
hashMap.put(new Employee("b"),"emp2");
hashMap.put(new Employee("a"),"emp1 overridden");
System.out.println(hashMap.size());
System.out.println(hashMap.get(new Employee("a")));
}
}
import java.util.HashMap;
class Employee{
private String name;
public Employee(String name){
this.name=name;
}
public boolean equals(Object obj){
return true;
}
}
public class Program
{
public static void main(String[] args) {
HashMap<Employee,String> hashMap=new HashMap<Employee,String>();
hashMap.put(new Employee("a"),"emp1");
hashMap.put(new Employee("b"),"emp2");
hashMap.put(new Employee("a"),"emp1 overridden");
System.out.println(hashMap.size());
System.out.println(hashMap.get(new Employee("a")));
}
}
import java.util.HashMap;
class Employee{
private String name;
public Employee(String name){
this.name=name;
}
public int hashCode(Object obj){
return (this.name==null ? 0: this.name.hashCode());
}
}
public class Program
{
public static void main(String[] args) {
HashMap<Employee,String> hashMap=new HashMap<Employee,String>();
hashMap.put(new Employee("a"),"emp1");
hashMap.put(new Employee("b"),"emp2");
hashMap.put(new Employee("a"),"emp1 overridden");
System.out.println(hashMap.size());
System.out.println(hashMap.get(new Employee("a")));
}
}
JAVA pinned Deleted message
TOP 10 SQL Concepts for Job Interview

1. JOINs (Inner/Left/Right/Self)
2. Group By and Order By
3. Aggregate Functions (sum/avg/max/min)
4. Union and Union All
5. Date and Time processing
6. String processing
7. Window Functions (Partition by)
8. Subquery
9. View and Index
10. Common Table Expression (CTE)

SQL Join is a very important concept for any Data Science or Analytics Job Interview as well as day to day work.

Please refer to this 3 page document for understanding different SQL Join types.

Once you have understood the concepts, please go ahead and practise it with some actual or sample data tables.

(Document Credit: Steve Stedman)

I’m sure SQL will help you a lot in your Data Science journey and make you an awesome Data Scientist. All the best! πŸ‘πŸ»

SHARE and TAG others so that others can also learn.

#DataScienceWithDrAngshu #DataScience #Analytics #BigData #MachineLearning #ArtificialIntelligence #Data #DataAnalytics #Python #SQL #Statistics #DataVisualisation #Interview #Job

Follow Dr. AngShuMan Ghosh (Ph.D., MBA, BE)
Gfg courses -:
https://mega.nz/folder/ud5xgKaA#qgonl3ihVBgiWK-z9aSZRg
For gfg DSA -:
[Part 1 -> 3.Data Structures (Advanced)]
Or follow this link (works on pc)
https://mega.nz/folder/ud5xgKaA#qgonl3ihVBgiWK-z9aSZRg/folder/SNJwnCCI
import java.util.PriorityQueue;
public class Main
{
public static void main(String[] args) {
PriorityQueue<Integer> p=new PriorityQueue<Integer>();
p.add(1);
p.add(2);
p.add(3);
System.out.println(p.poll());
System.out.println(p.offer(4));
p.add(1);
p.remove(2);
System.out.println(p.peek());
System.out.println(p);
}
}
Which allows the removal of elements from a collection?
Anonymous Quiz
27%
Enumeration
37%
Iterator
28%
Both
8%
None
The Comparator interface contains the method?
Anonymous Quiz
15%
compareWith()
61%
compareTo()
24%
compare()
Which of these is synchronized?
Anonymous Quiz
12%
TreeMap
23%
HashMap
28%
Hashtable
37%
All
Which is more offers best performance?
Anonymous Quiz
12%
TreeMap
27%
HashMap
30%
LinkedHashMap
30%
All are equal