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.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);
}
}
Options
Anonymous Quiz
35%
Runtime Exception
23%
Compile time exception
27%
{11=a, null=c}
15%
{11=a, null=null}
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")));
}
}
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")));
}
}
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")));
}
}
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")));
}
}
An overview of HTTP - HTTP | MDN
https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
MDN Web Docs
Overview of HTTP - HTTP | MDN
HTTP is a protocol for fetching resources such as HTML documents.
It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser.
A complete document isβ¦
It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser.
A complete document isβ¦
Polymorphism, Encapsulation, Data Abstraction and Inheritance in Object-Oriented Programming | nerd.vision
https://www.nerd.vision/post/polymorphism-encapsulation-data-abstraction-and-inheritance-in-object-oriented-programming
https://www.nerd.vision/post/polymorphism-encapsulation-data-abstraction-and-inheritance-in-object-oriented-programming
www.nerd.vision
Polymorphism, Encapsulation, Data Abstraction and Inheritance in Object-Oriented Programming | nerd.vision
A guide to Object Oriented Programming (OOP).
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)
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
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
mega.nz
File folder on MEGA
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);
}
}
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 is more offers best performance?
Anonymous Quiz
12%
TreeMap
27%
HashMap
30%
LinkedHashMap
30%
All are equal