<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sonia Mathias</title>
    <description>The latest articles on DEV Community by Sonia Mathias (@soniajm).</description>
    <link>https://dev.to/soniajm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F568965%2F7a3820b0-43e9-4935-b204-0577fee37603.png</url>
      <title>DEV Community: Sonia Mathias</title>
      <link>https://dev.to/soniajm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/soniajm"/>
    <language>en</language>
    <item>
      <title>Empowering Education: The Impact of EdTech Transformation</title>
      <dc:creator>Sonia Mathias</dc:creator>
      <pubDate>Wed, 20 Mar 2024 14:16:46 +0000</pubDate>
      <link>https://dev.to/soniajm/empowering-education-the-impact-of-edtech-transformation-5epo</link>
      <guid>https://dev.to/soniajm/empowering-education-the-impact-of-edtech-transformation-5epo</guid>
      <description>&lt;p&gt;In today’s world, EdTech offers unparalleled opportunities for interactive and immersive learning, transcending the limitations of traditional classroom settings. EdTech education represents a powerful catalyst for innovation and advancement in the educational sphere. Embracing its potential while addressing associated challenges can pave the way for a more dynamic, accessible, and impactful learning environment for learners of all ages and backgrounds.&lt;/p&gt;

&lt;p&gt;When it comes to software courses, several EdTech platforms stand out for offering comprehensive and high-quality content tailored to learners interested in programming, software development, and related fields. The top EdTech companies can vary based on criteria such as market share, innovation, impact, and user satisfaction. &lt;/p&gt;

&lt;p&gt;Here are some of the top 5 EdTech platforms for software courses &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/codecademy-review-make-you-cringe-steven-brooks/"&gt;Codecademy&lt;/a&gt;: Codecademy offers interactive coding courses focused on teaching programming languages and web development skills. Learners can start with introductory courses on languages like Python, HTML, CSS, and JavaScript and progress to more advanced topics such as data science and backend development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/udemy-web-development-bootcamp-review-winston-lan/"&gt;Udemy&lt;/a&gt;: Udemy is a popular online learning platform offering a vast array of software courses covering programming languages (such as Python, Java, JavaScript, and C++), web development, mobile app development, software engineering, and more. Courses are often created by industry professionals and updated regularly to keep up with the latest trends and technologies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/my-scaler-academy-experience-transitioning-software-developer-kumar-qiqkc/"&gt;Scaler Academy&lt;/a&gt;: Scaler Academy is a highly regarded EdTech platform renowned for its quality education, practical approach to learning, strong industry connections, and commitment to student success in the tech industry. It has garnered positive reviews from learners and professionals alike, making it a highly sought-after platform for those aspiring to excel in software engineering and data science roles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/coursera-certification-worth-svilen-atanasov/"&gt;Coursera&lt;/a&gt;: Coursera partners with universities and institutions worldwide to offer courses, specializations, and even online degrees in software-related fields. Learners can find courses on programming, software development methodologies, cloud computing, data structures and algorithms, and other relevant topics.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/review-edx-best-online-degrees-stem-brian-vander-waal-ohfze/"&gt;edX&lt;/a&gt;: Similar to Coursera, edX provides courses and programs in software development offered by universities and organizations. Learners can access courses on programming languages, software engineering principles, software testing, DevOps practices, and more.&lt;/p&gt;

&lt;p&gt;These are just a few examples, and the landscape of EdTech continues to evolve rapidly with new entrants and innovations.These platforms offer a mix of self-paced courses, live-online classes, interactive exercises, projects, and assessments to cater to different learning styles and preferences in software development.&lt;/p&gt;

</description>
      <category>development</category>
      <category>softwaredevelopment</category>
      <category>engineering</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Java Collections - Best Practices</title>
      <dc:creator>Sonia Mathias</dc:creator>
      <pubDate>Sun, 12 Jun 2022 13:28:14 +0000</pubDate>
      <link>https://dev.to/soniajm/java-collections-best-practices-3j53</link>
      <guid>https://dev.to/soniajm/java-collections-best-practices-3j53</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Java Collections are very popular and you might have heard of them if you have ever done programming in Java. If you are a Java programmer, you would have probably used the Java collections many times in your code. The Collection Framework is a Java framework that has many Interfaces in it that can be used to create pre-written data structures to ease our work. These data structures that we use in our code are called Java Collections. For instance, ArrayList, LinkedList, HashMap, HashSet, TreeSet, etc. are all Java Collections and a part of the Collection framework.&lt;br&gt;
So, in this article, we are going to discuss some of the best practices that you can apply while using Java Collections in your code. &lt;/p&gt;
&lt;h2&gt;
  
  
  Java Collections Best Practices
&lt;/h2&gt;

&lt;p&gt;Why is it important to know about the best practices? This is a very important question to address. Many programmers usually think that whatever they write is working so, why is there a need to learn some other way of doing it. The answer is very simple. Following the best practices makes the code clean, efficient, and more readable and also enhances one's skills as a software developer/problem solver. So, let us see what are some of the &lt;a href="https://www.interviewbit.com/java-collections-interview-questions/" rel="noopener noreferrer"&gt;best practices while using Java Collections&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Always try to use an Interface instead of a Class while declaring any Collection, for Method Arguments, and even while returning a Collection from any method.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a very basic point that many people lack while they are writing Java programs. Let us understand this with the help of some examples. Let us say we want to have an ArrayList of Integer in our code for performing some functions. The usual practice that many people follow while declaring an ArrayList is&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ArrayList&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;However, this is not the best practice. The best practice for declaring a Collection is declaring it using the Interface as shown below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;List&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, the question is why? Why should we declare it using an interface? The reason is simple. If we use Interface, it provides more functionality. If you have declared a List, you can later change it from ArrayList to LinkedList any time you want to. Similarly, if you declare a Set, we can use it as both HashSet and TreeSet. So, using an interface provides more flexibility in the code and hence we should always try to use an interface instead of a class.&lt;/p&gt;

&lt;p&gt;So, we should use an interface instead of a Class. However, this is not just valid while declaring the collection but also while passing an argument to any method or even returning a collection from the method. &lt;/p&gt;

&lt;p&gt;For example, let us say we have a list of input numbers and we want to select only odd numbers from them. A program for the same is shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.*;
import java.io.*;
class Main {

    public static List&amp;lt;Integer&amp;gt; selectOdds(List&amp;lt;Integer&amp;gt; numbers) {

         List&amp;lt;Integer&amp;gt; odd = new ArrayList&amp;lt;&amp;gt;();

         for(int no : numbers) {
             if(no % 2 != 0) {
                 odd.add(no);
             }
         }

         return odd;
    }

    public static void main(String args[]) throws Exception{
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        List&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();
        while(n-- &amp;gt; 0) {
            int x = scn.nextInt();
            list.add(x);
        }

        System.out.println("The list of odd numbers is");
        System.out.println(selectOdds(list));
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;a href="https://www.interviewbit.com/snippet/b741f502a1e510942d77/" rel="noopener noreferrer"&gt;Code Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: For Code Implementation- &lt;a href="https://www.interviewbit.com/online-java-compiler/" rel="noopener noreferrer"&gt;Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**Code Explanation: **In the above code, we take an input number N. Then, we input N numbers that are stored in the list. Then, we call our selectOdds() method which returns a list of all odd numbers out of the complete list.&lt;/p&gt;

&lt;p&gt;We have followed the best practice of using Interface instead of a class here as well. We have used List instead of ArrayList or LinkedList for both, as a return type as well as the argument of the method. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Always try to use isEmpty() for a collection over size() while checking for the emptiness of a Collection.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We often use Collections for storing some data in our programs. We might also try to empty the collection or check for its emptiness for performing some operations. In Java, it is always advised to use the isEmpty() method to check whether the collection is empty or not rather than checking whether the size is greater than zero or not. For instance, let us look at the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.*;
class Main {
    public static void main(String args[]) {

        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();

        List&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();

        while(n-- &amp;gt; 0) {
            int x = scn.nextInt();
            list.add(x);
        }

        //Less readable method for 
       //checking the emptiness of a Collection
        while(list.size() &amp;gt; 0) {
            System.out.print(list.remove(0) + " ");
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code Link: &lt;a href="https://www.interviewbit.com/snippet/f7b9be4cb50116be04c2/" rel="noopener noreferrer"&gt;Output&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**Code Explanation: **In the above code, we take an integer N as the input and then we input N values and add these values to an ArrayList. Now, till the ArrayList becomes empty, we keep on removing the element at index 0 from the ArrayList.&lt;/p&gt;

&lt;p&gt;So, instead of using the method shown above, we should use isEmpty() as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.*;
class Main {
    public static void main(String args[]) {

        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();

        List&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();

        while(n-- &amp;gt; 0) {
            int x = scn.nextInt();
            list.add(x);
        }

        //More readable method for 
    //checking the emptiness of a Collection
        while(!list.isEmpty()) {
            System.out.print(list.remove(0) + " ");
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code Link: &lt;a href="https://www.interviewbit.com/snippet/a1b9ffa0ccea93655ce7/" rel="noopener noreferrer"&gt;Output&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Explanation: **We have done the same thing that we did in the previous program. The only difference is that we use isEmpty() instead of using the size() method.&lt;br&gt;
**Is there a difference in the Time Complexities of size() and isEmpty()?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No, both these methods are the same performance-wise. The difference is in the readability of the code. Using the isEmpty() method increases the readability and hence it is preferred over the size() method and is considered a good practice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Always return Empty Collections rather than returning null.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We encounter such methods in Java in the everyday practice of programming where we have to return some Collection from a method. We should always return an empty Collection rather than returning null. &lt;/p&gt;

&lt;p&gt;The reason for this is that when we write APIs in Java or write the Java programs that interact with APIs, it can cause non-deterministic errors. Also, the performance of returning a null or an empty Collection is the same. So, we should return an empty Collection. This can be done in 2 ways. Let us say, we have a function where we have to return an ArrayList. So, one method of doing this can be:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;return new List&amp;lt;&amp;gt;();&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Another way to do this is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;return Collections.empty();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Try not to use the traditional For-Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For iterating over a Collection, you can either use the traditional for loop as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(int i=0;i&amp;lt;list.size();i++) {

     System.out.println(list.get(i));

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, “list” is an ArrayList Collection. Most people use the traditional for-loops only and there is nothing wrong with using them. However, it is preferred to use either an Iterator or a for-each loop instead of a traditional for-loop. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Traversal using Iterator *&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.*;
class Main {
    public static void main(String args[]) {
        // Your code goes here
        List&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();
        list.add(1);
        list.add(2);
        list.add(3);

        Iterator&amp;lt;Integer&amp;gt; it = list.iterator();

        while(it.hasNext()) {
            System.out.print(it.next() + " ");
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code Link: &lt;a href="https://www.interviewbit.com/snippet/ffbe55a8c708179ab8dd/" rel="noopener noreferrer"&gt;Output&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Explanation:&lt;/strong&gt; In the above code, we have entered the value 1,2 and 3 into a List. Then, we created an Iterator object for traversing the list. The hasNext() method is also a part of the predefined Java methods for traversing the Collections. Using the hasNext() we have traversed the Collection List and printed the value that were inside it.&lt;/p&gt;

&lt;p&gt;Now, let us see how we can traverse a Collection using for-each loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.*;
class Main {
    public static void main(String args[]) {
        // Your code goes here
        List&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();
        list.add(1);
        list.add(2);
        list.add(3);

        for(Integer a : list) {
            System.out.print(a + " ");
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code Link: &lt;a href="https://www.interviewbit.com/snippet/cf33dd6dd17e2cac0e58/" rel="noopener noreferrer"&gt;Output&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantage of Using For-Each Loop:&lt;/strong&gt; There are multiple advantages of using a for-each loop. They are easy to write and understand and increase the readability of the code. Apart from that, using an iterator or a for-each loop may throw an exception called ConcurrentModificationException. This exception takes place when we are traversing a Collection and trying to modify it at the same time in Java. Hence, using for-each loop is more secure as well as it can save us from big blunders in our program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. If possible, mention the capacity of a Collection.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is considered a good practice to mention the initial capacity of a Collection. Let us say that we have ArrayList in our program. We know that the ArrayList grows its size dynamically. Now, if we know that we are not going to store more than 10000 numbers in the ArrayList prior to writing the code, we should specify the capacity of the ArrayList to be 10000. This is because if the size is not specified, the ArrayList dynamically growing its size might grow its size even more than 10000. So, this is just a waste of memory. The size can be specified while declaring a Collection as follows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;List&amp;lt;Integer&amp;gt; list = new ArrayList&amp;lt;&amp;gt;(10000);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since we have mentioned the capacity of the collection, now it will not grow more than 10000 till you cross the 10000 mark of elements. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What will happen if we insert more elements after reaching the Capacity Limit set by us in the beginning?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, from the beginning i.e. when the ArrayList is empty, till you reach 10000 elements, the capacity of the ArrayList remains 10000 only. Now, let us say you cross 10000 elements, now the Capacity will again grow dynamically and you do not have any control over it again.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;6. Using the Correct Collections. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Finally, after discussing a lot of best practices that one should follow while using the Java Collections, here we are at the most important practice. Try to use the correct Collection always. What do mean by this? Let us understand this with the help of an example.&lt;/p&gt;

&lt;p&gt;Let us say that we want to store only unique values and the order of the values is not of concern to us. Then, we can go for HashSet Collection which serves the purpose of storing the unique elements only. We should not use a HashMap here as we only want to store some unique values and not some key-value pairs. Also, we should not use ArrayLists as they cannot store unique values only. In ArrayLists, duplicates are allowed.&lt;/p&gt;

&lt;p&gt;In the true sense, choosing the correct Collection seems to be an art. However, it is not. You just need to follow some rules in order to select the correct Java Collection. Some of the key points based on which you can select a Collection are as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Storing Values or Key-Value Pairs:&lt;/strong&gt; You need to be sure of what you want to store. If you want to store only values, then HashMap and TreeMap, and LinkedHashMap are not the Collections that you should go for, rather you should go for ArrayList, LinkedList, HashSet, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unique or Duplicate Values:&lt;/strong&gt; Again, you need to be sure whether you are going to store some unique values or duplicate ones. For instance, storing the names of Students will be storing duplicate data only as the names can be the same. However, if we choose to store enrollment numbers of these students, the Collection used for this should be the one that stores only unique values as Enrollment Numbers of 2 students are never the same.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Order Matter or not:&lt;/strong&gt; Again, a very important question to address is whether the order of the data that you are searching for/storing matters or not. For example, if you just want to store your data and want fast  searching, you can use an unordered Collection for this however, if you want the order to be maintained, you will have to choose an ordered collection.&lt;/p&gt;

&lt;p&gt;So, keeping these points in mind can help you choose the right Collection. The flowchart below is the correct way of making the decision on which collection to use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbv8q2elag48z2tw1nj3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbv8q2elag48z2tw1nj3t.png" alt="Flow Chart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above flowchart is the complete guide to deciding on the Best Collection. &lt;/p&gt;

&lt;p&gt;So, these were some of the best practices that one should follow while using Java Collections. &lt;/p&gt;

&lt;p&gt;Conclusion:&lt;/p&gt;

&lt;p&gt;So, we have studied some of the best practices that Java programmers and developers can follow while using the Java Collections. It is very important to understand that these practices are for you so that you can become a better programmer. The other practices might run your program correctly, but do reflect you as the best of the programmers. Hence, it is advised to follow them.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>.NET Core vs .NET Framework</title>
      <dc:creator>Sonia Mathias</dc:creator>
      <pubDate>Wed, 30 Mar 2022 15:48:57 +0000</pubDate>
      <link>https://dev.to/soniajm/net-core-vs-net-framework-51f9</link>
      <guid>https://dev.to/soniajm/net-core-vs-net-framework-51f9</guid>
      <description>&lt;p&gt;The debate between choosing the .NET Core and .NET Framework for developing applications is still evident in the tech domain. While the choice between .NET Core and the .NET Framework is largely determined by the type of application to be developed and the platform on which it will be developed, there are other aspects to consider before selecting a framework for your next web development project.&lt;/p&gt;

&lt;p&gt;.NET is a broad term as Microsoft supports both the .NET Core and .NET Framework frameworks. While the .NET Framework is the older and more traditional version, &lt;strong&gt;&lt;a href="https://www.interviewbit.com/dot-net-interview-questions/"&gt;.NET Core&lt;/a&gt;&lt;/strong&gt; has entered the tech domain to solve its shortcomings and keep up with technological advancements. However, this does not imply that the .NET Framework is losing its popularity.&lt;/p&gt;

&lt;p&gt;.NET and .NET Core are widely used software development frameworks, making them a robust choice for your upcoming application project.&lt;/p&gt;

&lt;p&gt;This article comprehensively explains the .NET Core and the .NET Framework. You'll gain valuable insights about the two frameworks as well as understand the differences between them. The key things discussed in this blog include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The .NET Environment&lt;/li&gt;
&lt;li&gt;Understanding .NET Core and the .NET Framework&lt;/li&gt;
&lt;li&gt;Major differences between the frameworks&lt;/li&gt;
&lt;li&gt;Which framework is better? &lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The .NET Environment:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;.NET is a free, open source developer platform for developing various types of applications. You can build web, mobile, gaming, IoT, and desktop applications with .NET by using multiple languages like C#, F#, or Visual Basic, as well as libraries, and editors.&lt;/p&gt;

&lt;p&gt;C# is a type-safe, simple, modern, object-oriented programming language.&lt;br&gt;
F# is convenient to develop code that is concise, reliable, and performant.&lt;br&gt;
Visual Basic is a user-friendly language with a simple syntax for creating type-safe, object-oriented applications.&lt;/p&gt;

&lt;p&gt;The .NET development framework supports two major platforms for developing applications. They are the .NET Framework, which has been around for the last two decades, and .NET Core. However, there are a cumulative of three major .NET ecosystem components: .NET Core, .NET Framework, and Xamarin.&lt;/p&gt;

&lt;p&gt;But Xamarin isn't involved in this discussion. If you want to create any mobile app, you can opt for Xamarin. It is compatible with the iOS, Android, or Windows' Mobile app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding .NET Framework and .NET Core&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  .NET framework:
&lt;/h2&gt;

&lt;p&gt;The .NET framework was first introduced in 2002. Microsoft intended for it to be the only single framework that would govern all programming languages. However, while .NET allowed developers to use over 60 programming languages (only 11 of which were developed by Microsoft), it was only available for Windows.&lt;br&gt;
Many developers, however, did not consider it a sticking point. Indeed, Microsoft has continued to improve the .NET framework. As a result, even with the launch of Silverlight and Xamarin, developers still continued to use .NET. However, when extending the compatibility of .NET to other platforms, portability concerns became more prevalent. &lt;/p&gt;

&lt;p&gt;Regardless of these transmutations to the framework, a genuine cross-platform ecosystem remained amorphous. .NET Core was born as a result of this.&lt;/p&gt;

&lt;h2&gt;
  
  
  .NET Core:
&lt;/h2&gt;

&lt;p&gt;Finally, in 2014, Microsoft decided to start working on a .NET reboot. In 2016, they released .NET Core, which was created primarily to facilitate cross-platform runtimes.&lt;br&gt;
It is the most recent version of Microsoft's .NET Framework. It's a free, open-source, and permutable design platform for software systems that provides support for code libraries and numerous scripting languages. It's a multi-platform framework that is compatible with Windows, Mac OS, and Linux. Online, cloud, IoT, microservices, machine learning, games, and more can all be built using the .NET Core Framework. It is modular, lightweight, and an agile framework that was built from the ground up.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;The Top 10 Major Differences Between .NET Core and .NET Framework &lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Differentiating Factors&lt;/th&gt;
&lt;th&gt;.NET Core&lt;/th&gt;
&lt;th&gt;.NET Framework&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Open Source&lt;/td&gt;
&lt;td&gt;.NET Core is a totally open-source platform.&lt;/td&gt;
&lt;td&gt;The .NET Framework only has a particular number of open source components.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Installation&lt;/td&gt;
&lt;td&gt;As .NET Core is a cross-platform compatible with various operating systems, it needs to be installed independently.&lt;/td&gt;
&lt;td&gt;.NET Framework is installed as a single package and runtime ecosystem for Windows.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application Models&lt;/td&gt;
&lt;td&gt;.NET Core’s application model comprises the ASP.NET and Windows apps.&lt;/td&gt;
&lt;td&gt;.NET Framework’s application model comprises Windows Presentation Foundation (WPF), ASP.NET, and Base Class Library (BCL).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compatibility&lt;/td&gt;
&lt;td&gt;.NET Core is compatible with multiple operating systems, including Windows, Mac OS, and Linux.&lt;/td&gt;
&lt;td&gt;On the flip side, .NET Framework is compatible only with the Windows OS.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;.NET Core renders high performance and scalability relative to .NET Framework due to its architecture.&lt;/td&gt;
&lt;td&gt;.NET Framework is less efficient as opposed to .NET Core with respect to performance and scalability of applications.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;.NET Core does not have the feature of Code Access Security.&lt;/td&gt;
&lt;td&gt;.NET Framework has the feature of Code Access Security, and hence is better than .NET Core in this regard.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment Model&lt;/td&gt;
&lt;td&gt;During the installation of a new version of .NET Core, it is updated promptly on one computer at a time, consequently creating new directories/folders in the existing program without affecting it. Hence, .NET Core has a robust and resilient deployment model.&lt;/td&gt;
&lt;td&gt;As far as the .NET Framework is concerned, when the updated version is released, it is initially deployed only on the Internet Information Server.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Microservices and REST Services Support&lt;/td&gt;
&lt;td&gt;.NET Core supports the development and running of microservices, but the user has to build a REST API for its implementation.&lt;/td&gt;
&lt;td&gt;.NET Framework lacks the development and implementation support for microservices, but it does support the REST API services.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Versatility&lt;/td&gt;
&lt;td&gt;.NET Core supports open-source mobile application platforms, like Xamarin, through the .NET Standard Library. Developers leverage Xamarin’s tools to build mobile apps for certain mobile devices like iOS, Android, and Windows phones.&lt;/td&gt;
&lt;td&gt;On the contrary, .NET Framework is not suitable for mobile application development.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Packaging and Shipping&lt;/td&gt;
&lt;td&gt;.NET Core is shipped as a cluster of Nugget packages.&lt;/td&gt;
&lt;td&gt;.NET Framework’s libraries are packaged and shipped together.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLI Tools&lt;/td&gt;
&lt;td&gt;.NET Core offers light-weight editors and Command Line Interface tools for all platforms. You can also pivot to IDE, if you need them.&lt;/td&gt;
&lt;td&gt;.Net Framework is heavy for the CLI, which makes developers prefer lightweight Command Line Interface.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;*&lt;em&gt;Which framework should you use? *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The short answer is, ‘It depends.’ It depends on the type of application you are looking to develop and which platform would be best to meet the requirements of the project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use .NET Core when:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using microservices, as .NET Core is lightweight, enables a combination of tools, and can be minimised microservices.&lt;/li&gt;
&lt;li&gt;Performance and scalability are top priorities for you. In such situations, Microsoft suggests running .NET Core with ASP.NET Core.&lt;/li&gt;
&lt;li&gt;You need to run applications that need several versions of .NET simultaneously.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Use .NET Framework when:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your applications are compatible with Windows only.&lt;/li&gt;
&lt;li&gt;The developed applications run only on .NET Framework.&lt;/li&gt;
&lt;li&gt;Applications need tools that are not provided by .NET Core.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this point, we’re sure that you should have understood the distinctions between .NET Core and .NET Framework. In basic terms, .NET Core is the most recent version of Microsoft's .NET Framework, It is an open-source, free, and widely used development platform. It is compatible with Windows, Mac OS, and Linux. The .NET Core Framework might be used to create an assortment of applications. Whereas, Microsoft's .Net Framework is a software programming platform for developing and running Windows applications. .Net Framework encompasses programming languages, developer tools, and libraries that are used to build desktop and web applications. It is likewise used to develop games, websites, and other online solutions.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Top Python Libraries Every Python Developer Should Know in 2022</title>
      <dc:creator>Sonia Mathias</dc:creator>
      <pubDate>Thu, 21 Oct 2021 09:51:03 +0000</pubDate>
      <link>https://dev.to/soniajm/top-python-libraries-every-python-developer-should-know-in-2022-2dlb</link>
      <guid>https://dev.to/soniajm/top-python-libraries-every-python-developer-should-know-in-2022-2dlb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Python programming language developed by Guido Van Rossum in the 1990s is ranked as the third most popular programming language in the Stack Overflow Developer Survey 2021. Numpy and Pandas packages of Python are the preferred choices of 33.84% and 28.12% of developers globally and are primarily used in Data Science and Machine Learning.&lt;/p&gt;

&lt;p&gt;The Python programming language ranks fourth in terms of the most readily available package, there are high chances that whatever you are trying to build, there is already a package dedicated to it making your life a lot easier. All of these facts are a clear indication of the ever-growing popularity of Python Programming Language. &lt;/p&gt;

&lt;p&gt;The reason for Python being one of the most popular programming language are:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy-syntax making it beginner friendly and easy to learn.&lt;/li&gt;
&lt;li&gt;Versatility allowing the developers to create a vast range of applications&lt;/li&gt;
&lt;li&gt;Exhaustive collection of libraries. As of 1st September 2021, over 324,836 Python packages can be accessed through PyPI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This blog introduces the list of top python libraries along with its features and applications. A python library is basically a collection of modules and pre-combined codes that can be used to iteratively reduce the time required to code. Instead of writing the code from scratch Python libraries can be used to access the pre-written frequently used codes. &lt;/p&gt;

&lt;p&gt;Feel free to explore the libraries mentioned below by making &lt;a href="https://www.interviewbit.com/online-python-compiler/" rel="noopener noreferrer"&gt;python projects&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  TensorFlow
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv90wr0s8w9iuz8fqo46r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv90wr0s8w9iuz8fqo46r.png" alt="TensorFlow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are working on Machine Learning based projects or are looking to switch to Machine Learning then there are very high chances that you will use TensorFlow. The TensorFlow library developed by Google in collaboration with the Brain team is a part of almost every google application for Machine Learning. It is ranked as the most popular deep learning framework. &lt;/p&gt;

&lt;p&gt;The name “TensorFlow” is derived from the operations that neural networks perform on multidimensional data arrays or tensors, it's literally a flow of tensors. This is primarily used for developing and training highly efficient Machine Learning and Deep Learning Models.&lt;/p&gt;

&lt;p&gt;TensorFlow works like a computational library for writing new algorithms that involve a large number of tensor operations, since neural networks can be easily expressed as computational graphs they can be implemented using TensorFlow as a series of operations on Tensors.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;The tensorflow library makes use of techniques like XLA to perform linear algebra operations quickly. Let us look at the important features of TensorFlow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to train on CPU as well as GPU for distributed computing.&lt;/li&gt;
&lt;li&gt;Tensorflow offers a responsive construct in the sense that each and every part of the graph unlike Numpy or Scikit.&lt;/li&gt;
&lt;li&gt;It is supported by a wide range of operating systems including macOS 10.12.6 (Sierra) and later, Ubuntu 16.04 and later, Windows 7 and above, Raspbian 9.0 or later.&lt;/li&gt;
&lt;li&gt;A large team of software engineers who work on improvements continuously and as it is open source anyone can use it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;TensorFlow has had a huge number of applications in various fields including, Image Classification, Object Detection, Pose Estimation, Speech Recognition, Gesture Recognition, Segmentation, Natural Language Question Answering and Super Resolution. Some of the interesting projects developed using TensorFlow are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deep Speech Developed by Mozilla is a TensorFlow implementation.&lt;/li&gt;
&lt;li&gt;Google Creative Labs Teachable Machine which uses TensorFlow.js it lets you teach using your computer camera, live in the browser.&lt;/li&gt;
&lt;li&gt;Giorgio Camthat lets you make music by clicking pictures is developed using TensorFlow.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Keras
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21d79lb7z7oda47igt6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21d79lb7z7oda47igt6n.png" alt="Keras"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keras is a powerful and easy to use free open source deep learning API written in Python and built on top of TensorFlow used for developing and evaluating deep learning models.. It has been developed by an artificial intelligence researched at Google named Francois Chollet. Keras is an industry-strength framework that can scale to large clusters of GPU. It wraps the efficient numerical computation libraries, Theano and TensorFlow and allows to define and train neural network models in just a few lines of code. Keras’ impressive deployment capabilities let you deploy your models on a variety of platforms, including web browsers, embedded devices, iOS, and Android devices.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;In the survey conducted by Developer Committee of Keras in 2019, Keras ranked as #1 for deep learning both among primary frameworks and all other frameworks used.The main features of Keras are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keras integrates deeply with low-level TensorFlow functionality; it enables you to develop highly hackable workflows where any piece of functionality can be customized.&lt;/li&gt;
&lt;li&gt;Deep learning models developed using Keras can be easily deployed on a greater range of platforms including in the browser via TF.js, on Raspberry Pi, on Edge TPU, on server via python runtime as compared to any other deep learning API.&lt;/li&gt;
&lt;li&gt;With over 400,000 individual users as of early 2021, Keras has strong adoption across both the industry and the research community.&lt;/li&gt;
&lt;li&gt;Keras prioritizes developer experience by following best practices for reducing cognitive load, offering consistent and simple APIs and giving clear and actionable feedback upon user error.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;There are 10 pretrained models available in Keras. These models are used for image classification and their weights are trained on ImageNet dataset. The models are available in the “applications” module of Keras. Many industries use Keras as their primary deep learning framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is used by CERN, NASA, NIG and many other scientific organizations around the world.&lt;/li&gt;
&lt;li&gt;Netflix, Uber, Instacart, Zocdoc, Square, and many other have features built with keras.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  PyTorch
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gpox8sui4gt8hpk09b7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gpox8sui4gt8hpk09b7.png" alt="PyTorch"&gt;&lt;/a&gt;&lt;br&gt;
The PyTorch library of Python developed by Soumith Chintala in 2017 provides tools and libraries for developing GPU-powered machine learning applications. It allows you to create dynamic computational graphs and calculate gradients automatically. PyTorch also offers a rich API support to solve application issues related to neural networks. One of the most interesting fact about PyTorch is that it offers a C++ interface as well apart from the usual Python interface. The growing developer interest in the PyTorch library since its inception can be attributed to its easy syntax, useful libraries, support for dynamic computation graphs and excellent community support.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9drpuni8xab1ri1gk8x8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9drpuni8xab1ri1gk8x8.png" alt="PyTorch Graph"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;PyTorch provides a great platform to execute deep learning models with increasing flexibility and speed built to deeply integrate with python. Some of the interesting features of PyTorch are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An active community of researchers and developers have built a rich ecosystem of tools and libraries across various domains such as Computer Vision and Natural Language Processing, pro_gan_pytorch to leverage ProGAN features, MUSE for multilingual word embeddings and skorch for fusing scikit-learn code with PyTorch.&lt;/li&gt;
&lt;li&gt;Using PyTorch huge data sets can be efficiently divided into batches which then are sent to multiple GPUs for processing, this way a significant chunk of workload is shifted from CPU to GPU. Thus PyTorch aids in Data Parallelism.&lt;/li&gt;
&lt;li&gt;From version v1.3 of PyTorch, there is support for deployment on Android and iOS devices as well. &lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;PyTorch gives birth to a range of unique and exciting deep learning projects and libraries. It is primarily used for Natural Language processing. Some of the real-world applications of PyTorch are enlisted below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CheXNet helps radiologists detect pneumonia on chest X-rays and is developed using PyTorch.&lt;/li&gt;
&lt;li&gt;Uber’s PYRO, a universal probabilistic programming language, is written in Python and supported by PyTorch on the backend.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Theano
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp82qk8d7tta3wuizbuj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp82qk8d7tta3wuizbuj.png" alt="Theano"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Theano library of Python created by  Montreal Institute for Learning Algorithms is used to perform computations on mathematical expressions. It is built on top of Numpy and is used to carry out intensive mathematical and scientific calculations. Theano’s support for GPUs speeds up the computation time up to 140 times than what’s achievable with a CPU. The library can be downloaded easily from PyPI or with the following command “pip install Theano”.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features:
&lt;/h3&gt;

&lt;p&gt;Robust capabilities of Theano makes it a quite suitable option for computationally intensive scientific research tasks as well, it's also quite efficient for smaller workloads as well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Theano can find out unstable expressions and can use a stable means to calculate them.&lt;/li&gt;
&lt;li&gt;Theano can make use of GPUs to execute parts of expression making it quite faster than Python.&lt;/li&gt;
&lt;li&gt;Theano can detect and diagnose multiple types of errors and ambiguities in the model.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Applications:
&lt;/h3&gt;

&lt;p&gt;Theano is the strength of multiple neural network projects today and the popularity of Theano is only growing with time. Following are the main application areas of Theano&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It specifically handles the type of computation for large neural network algorithms in deep learning.&lt;/li&gt;
&lt;li&gt;A lot of useful libraries are built on top of theano including Lasagne, Keras, rllab, Blocks, Theano_lgpl, Downhill,  Morb, MonteTheano and many more.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scipy
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbhmmpbtmj7wtmy44kj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbhmmpbtmj7wtmy44kj7.png" alt="Spicy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The SciPy library stands for Scientific Python. It was developed by Numpy’s creator Travis Olliphant. It's predominantly written in Python, and few segments are written in C.&lt;/p&gt;

&lt;p&gt;It is a scientific python open source distributed under the BSD licensed library to perform mathematical, scientific and engineering computations. The libraries offered by the entire SciPy ecosystem including Numpy, Matplotlib, Pandas, IPython and SymPy have been curated to provide a convenient library stack that can take on intensive computations from domains like mathematics, science, and engineering, making things easier for data scientists and developers alike.The library is available for download with a simple command “pip install scipy”. It's important to note that although the SciPy stack consists of other libraries as well, you will need to install them separately.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;It provides many user-friendly and efficient numerical routines, such as routines for numerical integration, interpolation, optimization, linear algebra, and statistics. Some of the important features of Scipy are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It contains varieties of sub packages which solve the common issues related to Scientific Computation.&lt;/li&gt;
&lt;li&gt;The SciPy package in Python is the most used Scientific library only second to GNU Scientific Library for C/C++ or Matlab.&lt;/li&gt;
&lt;li&gt;Easy to use and understand as well as fast computational power.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;The main application areas of Scipy is that it contains modules for various commonly used tasks in scientific programming, including linear algebra, integration (calculus), ordinary differential equation solving, and signal processing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pandas
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjh9z184j0xql9difsuyu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjh9z184j0xql9difsuyu.png" alt="Pandas"&gt;&lt;/a&gt;&lt;br&gt;
Pandas library developed by Wes McKinney is a popular high-performance Python library widely used for solving Machine Learning and Data Science Problems. Python with Pandas is used in a wide range of fields including academic and commercial domains including finance, economics, Statistics, analytics, etc.It offers flexible and extremely responsive Data structures for working with time series and structured data along with a stack of other vital features. Pandas have so many inbuilt methods for grouping, combining data, and filtering, as well as time-series functionality.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;Let us look at the various features of Pandas library in Python:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's a foundational library for analytics, data processing and data science.&lt;/li&gt;
&lt;li&gt;Pandas have a fast and efficient DataFrame object which supports default and customized indexing.&lt;/li&gt;
&lt;li&gt;Pandas supports high performance merging and joining of data.&lt;/li&gt;
&lt;li&gt;Pandas also supports label-based slicing, indexing and subsetting of large data sets.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;Pandas packages of Python are the preferred choices of 28.12% of developers globally and are primarily used in Data Science and Machine Learning. The major applications of Pandas library in Python are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Economists all around the world are using Pandas library's comprehensive set of tools like dataframe and file handling to analyze huge datasets.&lt;/li&gt;
&lt;li&gt;Personalized advertising models which are responsible for showing personalized ads to the customers go through the custom data to learn and understand what the customer wants, to analyze the customer data in such cases Pandas library is used.&lt;/li&gt;
&lt;li&gt;Pandas helps in analytics using its amazing data manipulation and handling capabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Numpy
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxgs2lvnmznd11bonm98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxgs2lvnmznd11bonm98.png" alt="Numpy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The numpy library developed by Travis Oliphant is the fundamental package for python providing support for large multidimensional arrays and matrices along with a collection of high-level mathematical functions to execute these functions.&lt;/p&gt;

&lt;p&gt;It relies on BLAS and LAPACK for efficient linear algebra computations. TensorFlow uses Numpy internally for performing multiple operations on Tensors.The two vital benefits that NumPy has to offer is the support for powerful N-dimensional array objects and built-in tools for performing intensive mathematical as well as scientific calculations. If you want to give this library a try, you can do so by adding it to your system with the command “pip install numpy”.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;The features of Numpy are enlisted below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Numpy makes complex mathematical implementations very simple owing to its easy syntax and wide range of in-built functions.&lt;/li&gt;
&lt;li&gt;Numpy uses an optimized C core for delivering high performance, interoperability with various computing platforms and hardware, and ease of use.&lt;/li&gt;
&lt;li&gt;It plays well with visualization libraries such as Matplotlib, Seaborn and Plotly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Numpy can be utilized for expressing images, sound waves, and other binary raw streams as an array of real numbers in N-dimensional. The real power of numpy lies in its support for n-dimensional arrays.&lt;/li&gt;
&lt;li&gt;Numpy library is frequently used in projects related to Data Science and Machine Learning.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Matplotlib
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4u5i0r0jsr4l1oceith.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4u5i0r0jsr4l1oceith.png" alt="Matplotlib"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Matplotlib library developed by John D. Hunter is one of the most popular visualization libraries for Python. Matplotlib is a comprehensive library for creating static, animated and interactive visualizations in Python by creating a wide variety of visualizations, including line plots, histograms, bar charts, pie charts, scatter plots, tables, and many other styles.Matplotlib is written in Python and makes use of NumPy, the numerical mathematics extension of Python. It provides an object-oriented API that helps in embedding plots in applications using Python GUI toolkits such as PyQt, WxPythonotTkinter. It can be used in Python and IPython shells, Jupyter notebook and web application servers also.&lt;/p&gt;

&lt;p&gt;You can add Matplotlib to your development environment using the command, “pip install matplotlib”.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;The latest version of Matplotlib 3.3 supports some really exciting features, some of the latest highlighted feature are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Offers a semantic way to generate complex, subplot grids.&lt;/li&gt;
&lt;li&gt;Colored Labels in legends.&lt;/li&gt;
&lt;li&gt;rcParams can be passed as Decorators.&lt;/li&gt;
&lt;li&gt;3D plots now support minor ticks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;Matplotlib is majorly used to visualize the data using interactive graphs and plots. It is majorly used in Data Science and Machine learning to get insights on data.&lt;/p&gt;

&lt;h3&gt;
  
  
  PyGame
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgp2p957nsvdi00ecqwf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgp2p957nsvdi00ecqwf.png" alt="PyGame"&gt;&lt;/a&gt;&lt;br&gt;
The Pygame library in Python developed by Pete Shinners is used to provide developer access to game development tools and libraries. It's the best and most popular game development library provided by Python and is cross-platform. It is built on top of SDL(Simple DirectMedia Layer) which provides low-level access to computer hardware like keyboard, mouse, and graphics hardware like the GPU via OpenGL and Direct3D.&lt;/p&gt;

&lt;p&gt;If you want to give game development using PyGame a try, you can install the library easily using the command, “pip install pygame”.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;Pygame is a cross-platform library offering tons of useful features that aids in Fame development. Some of them are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is easy to use and fully modular.&lt;/li&gt;
&lt;li&gt;It offers a rich support for multi-core systems and is highly portable.&lt;/li&gt;
&lt;li&gt;Advanced gaming features like detecting collisions, vector math, pixel-array manipulation and much more.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;The PyGame library of  Python is used to develop high-quality industry level games. Some of the popular PyGame projects include Flappy Bird, Snake Game, Sudoku Game, Retro Racing Game, Quabro.&lt;/p&gt;

&lt;h3&gt;
  
  
  BeautifulSoup
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcd50xcqwcl0gwfbwgg1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcd50xcqwcl0gwfbwgg1.png" alt="BeautifulSoup"&gt;&lt;/a&gt;&lt;br&gt;
The BeautifulSoup library developed by Leonard Richardson is among the top libraries for web scraping and is used to scrape all or specified data from web pages.&lt;/p&gt;

&lt;p&gt;The purpose of creating this library was to make information gathering from web pages a painless activity. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work.Installation of the library is straightforward, just run the command “pip install beautifulsoup4”, which downloads the latest v4 of the library that supports Python 3.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features:
&lt;/h4&gt;

&lt;p&gt;Some of the features of the library are mentioned below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Information gathering from web pages using BeautifulSoup is very simple.&lt;/li&gt;
&lt;li&gt;It also allows handling various other aspects like navigation, modification of the parse tree and searching for the desired data.&lt;/li&gt;
&lt;li&gt;Beautiful Soup automatically converts incoming documents to Unicode and outgoing documents to UTF-8.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Applications:
&lt;/h4&gt;

&lt;p&gt;The BeautifulSoup library in Python is widely used in web scraping. Some of the applications are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Effective method to extract data from websites.&lt;/li&gt;
&lt;li&gt;Scraped data using the bs4 library can be used in price comparison and competition monitoring in the E-commerce industry.&lt;/li&gt;
&lt;li&gt;It is also extensively used in tweets analysis, wherein all the tweets related to a particular hashtag needs to be&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Conclusion:
&lt;/h4&gt;

&lt;p&gt;The “Python library” contains several different kinds of components. It contains data types that would normally be considered part of the “core” of a language, such as numbers and lists, The library also contains built-in functions and exceptions — objects that can be used by all Python code without the need of an import statement. &lt;/p&gt;

&lt;p&gt;Apart from the nine libraries explored above, there are plenty of other important and useful libraries as well, you will get to know them once you start making projects. Learning by doing is what an aspiring developer must do!!.&lt;/p&gt;

&lt;p&gt;Happy Learning!!&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>C# Interview Questions for Experienced</title>
      <dc:creator>Sonia Mathias</dc:creator>
      <pubDate>Mon, 26 Apr 2021 07:06:38 +0000</pubDate>
      <link>https://dev.to/soniajm/c-interview-questions-for-experienced-1e0p</link>
      <guid>https://dev.to/soniajm/c-interview-questions-for-experienced-1e0p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction to C#:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;C# is a general-purpose programming language that covers a wide range of topics such as object-oriented programming, component-oriented programming, static typing, and strong typing. C# is a programming language that is commonly used in the ASP.NET &lt;br&gt;
framework to create websites, web apps, and games. Microsoft launched C# in 2000 as a modern general-purpose programming language that can be used to create applications for a variety of platforms, including Windows, Web, and mobile devices, by using a single programming language. C# is now one of the most widely used programming languages on the planet. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Some Commonly Asked C# Interview Questions For Experienced:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q1. What is the Diamond problem in C#?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. When two classes V and W both inherit from U, and class X inherits from both V and W, the "diamond problem" occurs. If V and W have overridden a method in U, but X does not, which class of the method does X inherit: V's or W's? As a result, there is an uncertainty in multiple inheritances in C#. It's also known as an ambiguity problem in C# because it doesn't allow multiple inheritances. It can be resolved using the interface in C# which allows multiple class inheritance,&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3s1kavdz3ugbm2ye1f4h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3s1kavdz3ugbm2ye1f4h.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2. What is LINQ in C#?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. Language-Integrated Query (LINQ) is a query language that was implemented in.NET 3.5 and Visual Studio 2008. The usefulness of LINQ is that it allows.NET languages (such as C#, VB.NET, and others) to generate requests to extract data from a data source. For a particular type of data source or data format, the user does not need to learn new query languages. It is possible to reuse a query. In C#, LINQ is available in the System. Linq namespace. It includes a variety of classes and methods that can be used to run LINQ queries. This namespace contains the following elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enumerable class contains standard query operators that operate on objects which run IEnumerable.&lt;/li&gt;
&lt;li&gt;Queryable class contains standard query operators that operate on objects which run IQueryable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Q3. List some differences between delegates and interfaces in C#.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Delegate&lt;/th&gt;
&lt;th&gt;Interface&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;It is an object that contains a reference to a method only.&lt;/td&gt;
&lt;td&gt;It contains methods, events, indexers, and properties.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It is applied to a single method at a time.&lt;/td&gt;
&lt;td&gt;When a class implements an interface, it also implements all of the interface's methods.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You can use a delegate if it is available in your scope.&lt;/td&gt;
&lt;td&gt;If your class implements the interface, it is used; otherwise, it is not.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delegate can be implemented as many times as needed.&lt;/td&gt;
&lt;td&gt;Interface can be implemented only once.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It is used to handle events.&lt;/td&gt;
&lt;td&gt;It is not used to handle events.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anonymous methods can be accessed by a delegate.&lt;/td&gt;
&lt;td&gt;Interface cannot access anonymous methods.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When you use a delegate to access a process, you don't need access to the class's object where the method is declared.&lt;/td&gt;
&lt;td&gt;When you use a delegate to access a process, you don't need access to the class's object where the method is declared.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You'll need the object of the class that implements an interface to access the method.&lt;/td&gt;
&lt;td&gt;It cannot support inheritance.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It cannot support inheritance.&lt;/td&gt;
&lt;td&gt;It can support inheritance.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delegates are created at run time.&lt;/td&gt;
&lt;td&gt;Interfaces are created at compile time.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Any method with the same signature as the given delegate can be implemented.&lt;/td&gt;
&lt;td&gt;If the interface method is implemented, the same name and signature method override.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It has the ability to wrap both static and sealed class methods. It can wrap any method with a signature that is identical to that of the delegate, regardless of which class it belongs to.&lt;/td&gt;
&lt;td&gt;Static and sealed class methods are not wrapped by the interface. A class can implement any number of interfaces, but it can only override the interfaces' methods.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Q4. List some differences between Class and Structure in C#.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Class&lt;/th&gt;
&lt;th&gt;Structure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Class is of reference types.&lt;/td&gt;
&lt;td&gt;Struct is of value types.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Allocation of all reference types is done on heap memory.&lt;/td&gt;
&lt;td&gt;Allocation of all value types is done on stack memory.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Class is generally used in large programs.&lt;/td&gt;
&lt;td&gt;Struct is used in small programs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A class can contain a constructor or destructor.&lt;/td&gt;
&lt;td&gt;A struct cannot contain parameterless constructor or destructor, but can contain parameterized constructor or static constructor.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A class uses the ‘new’ keyword to create instances.&lt;/td&gt;
&lt;td&gt;A struct can create an instance, with or without the ‘new’ keyword.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A class can inherit from another class.&lt;/td&gt;
&lt;td&gt;A struct cannot inherit from another struct or class.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A class can have protected data members.&lt;/td&gt;
&lt;td&gt;A struct cannot have protected data members.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A class can have virtual or abstract function members.&lt;/td&gt;
&lt;td&gt;A struct cannot have virtual or abstract function members.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In a class, two variables can contain the reference of the same instance, and any operation on one variable will affect the other variable.&lt;/td&gt;
&lt;td&gt;In a struct, each variable contains its own copy of data (except the ref and out parameter variables) and any operation on one variable will not affect the other variable.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Q5. Discuss Thread Priority in Multithreading in C#.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. Each thread in a multithreading environment has its own priority. The priority of a thread indicates how often it is granted access to CPU resources. When we generate a thread in C#, we always give it a priority. &lt;/p&gt;

&lt;p&gt;A programmer can give a thread explicit priority. A thread's priority is set to Normal by default. ThreadStateException is thrown when a thread reaches its final state, such as Aborted. ArgumentException will be thrown if the value defined for a set operation is not a valid ThreadPriority value. Setting the thread priority to highest would not correspond to real-time execution since the thread priority is either determined by the process priority or parent container. The Thread. Priority property is used to get or set a value that represents a thread's scheduling priority.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q6. Differentiate between Method Overriding and Method Hiding in C#.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method overriding&lt;/th&gt;
&lt;th&gt;Method hiding&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The method of a parent class must be defined as a virtual method using the virtual keyword, and the method of a child class must be defined as an overridden method using the override keyword.&lt;/td&gt;
&lt;td&gt;In method hiding, you simply build a method in a parent class and define it with the new keyword in the child class.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Only the implementation of the method is redefined in method overriding.&lt;/td&gt;
&lt;td&gt;You can totally redefine the method in method hiding.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overriding is an object type here.&lt;/td&gt;
&lt;td&gt;Hiding is a reference type here.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The compiler can not override the method if you do not use the override keyword. Instead of overriding the method, the compiler will hide it.&lt;/td&gt;
&lt;td&gt;If you don't use the new keyword, the compiler will hide the base class's method by default.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When a reference variable in the base class points to an object in the derived class, the overridden method in the derived class is called.&lt;/td&gt;
&lt;td&gt;When a reference variable in the base class points to an object in the derived class, the hidden method in the base class is called.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Q7. Illustrate Parsing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. Parsing is a method to convert a string into some other data type. Parse in C# is used to parse a string into a primitive data type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Standard Parse
dataType variable_name = dataType.Parse(string_name);

//TryParse takes care of failure, no need for try-catch
dataType outcome;
bool ifSuccessful = dataType.TryParse(string_name, out outcome);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Q8. Differentiate between finalize() and dispose() methods.&lt;/p&gt;

&lt;p&gt;Ans.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;dispose( )&lt;/th&gt;
&lt;th&gt;finalize( )&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The dispose( ) method is defined in the IDisposable interface.&lt;/td&gt;
&lt;td&gt;The finalize( ) method is defined in java.lang.object class.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;This method is invoked by the user.&lt;/td&gt;
&lt;td&gt;This method is invoked by the garbage collector.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The dispose( ) method, whenever invoked, is used to free unmanaged resources and is to be implemented whenever there is a close( ) method.&lt;/td&gt;
&lt;td&gt;The finalize( ) method frees unmanaged resources before the object is destroyed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dispose( ) is declared as public.&lt;/td&gt;
&lt;td&gt;finalize( ) is declared as private.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The dispose( ) method performs action instantaneously. Hence, it does not hamper the performance of websites.&lt;/td&gt;
&lt;td&gt;The finalize( ) method, being slower, hampers the performance of the websites.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Q9. What are Events in C#?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. User actions such as key presses, clicks, mouse movements, and so on, as well as occurrences such as machine-induced alerts, are examples of events. Applications must respond to events as soon as they occur. Interrupts, for example. Inter-process coordination is accomplished by the use of events. The events are declared and raised in a class, and event handlers are affiliated with them using delegates from the same or another class. The event is published using the class that contains it. The publisher class is what it's called. The subscriber class is another class that accepts this event. The publisher-subscriber model is used for events.&lt;/p&gt;

&lt;p&gt;A publisher is an object that includes the event and delegate definitions. This object also defines the event-delegate relationship. The event is triggered by a publisher class object, which then notifies other objects. A subscriber is a type of object that accepts events and responds with a handler. The delegate in the publisher class calls the subscriber class's method (event handler). An event is an encapsulated delegate in C#. The signature for the subscriber class's event handler method is defined by the delegate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q10. What is C# Deadlock?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. A deadlock in C# can be described as a situation in which two or more processes are completely motionless or frozen in their execution because they are waiting for each other to finish. A deadlock can occur when a resource, that is shared among multiple threads, is held up and the rest of them are waiting to cause a deadlock.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q11. Differentiate between System.Array.CopyTo() and System.Array.Clone().&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. Array.Clone() returns an object that contains a shallow copy of all the elements in the source array. Array.CopyTo() copies all of the current array's elements to the designated destination array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q12. Discuss async and await.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. C# introduced the async and await keywords to render asynchronous programming on the.NET platform easier. In much of the C# ecosystem, these keywords have radically changed how code is written. These keywords were created in response to the difficulties encountered when using the Task and Task classes.&lt;/p&gt;

&lt;p&gt;To use the await keyword in the function, the async keyword is added to the method signature. It also tells the compiler to make an asynchronicity-handling state machine. An async method's return type is always Task or Task. Since it is tested by the compiler, there isn't much scope for error. &lt;/p&gt;

&lt;p&gt;The await keyword is used to wait for a Task or Task to finish asynchronously. It pauses the current method's execution until the asynchronous task that is being awaited finishes. The await keyword differs from calling.Result() or .Wait() in that it returns the current thread to the thread pool rather than keeping it blocked.&lt;/p&gt;

&lt;p&gt;For the remainder of the async process, it generates a new Task or Task object. It assigns this new task as a follow-up to the awaited task and assigns background requirements for the continuation task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q13. Describe the accessibility modifier "protected internal".&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. The keyword combination, protected internal, is a member access modifier. It makes a data member accessible in any type within its current assembly. This data member is also accessible in an inherited class located in another assembly if the access is made through a variable of the derived class type.&lt;br&gt;
Example:-&lt;br&gt;
Accessing protected internal member within the current assembly:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class A
{
   protected internal int x = 0;
}
class B
{
    void fun()
    {
        var obj = new A();
        A.x = 5;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, x is a protected internal data member of class A. It is accessed in a member function of class B which is in the same assembly. So, this code runs correctly.&lt;/p&gt;

&lt;p&gt;Accessing protected internal member within a derived class in another assembly :-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class A
{
   protected internal int x = 0;
}

class B : A
{
    static void Main()
    {
        var objA = new A();
        var objB = new B();

        // Error as x can only be accessed by classes derived from A.
        // objA.x = 10;
        // Executes because the protected internal member is being accessed through derived class's object
        objB.x = 10;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Q14. What is Anonymous Method in C#?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. An anonymous method, which was added in C# 2.0, is a method that doesn't have a name. The delegate keyword is used to define an anonymous method, which the user can then assign to a delegate type variable. The inline method is another name for this method. This method allows you to construct a delegate object without having to write separate methods. Outer variables, which are the variables in the outer method, can be accessed by this method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax:
delegate(parameter_list)
{
    Code
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Q15. What are Nullable types in C#?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. The compiler in C# prevents you from assigning a null value to a variable. As a result, C# 2.0 introduces the Nullable type, which allows you to assign a null value to a variable. The Nullable type allows you to give a variable a null value. Nullable types are only compatible with Value Types, not Reference Types, as implemented in C#2.0. Nullable types for Reference Types were implemented in C# 8.0 in 2019 to allow us to specifically define whether or not a reference type can hold a null value. This allowed us to solve the NullReferenceException problem without having to use conditionals. A Nullable type is an object of System.Nullable struct.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nullable variableName = null;&lt;/p&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;p&gt;datatype? variableName = null;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q16. What is the use of lambda expression in C#?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. A lambda expression is an easy way of defining an anonymous (unnamed) method that can be passed around as a variable or as a parameter to a method call. A function, called delegate, is taken as a parameter by many LINQ methods. The following example shows what a lambda expression looks like:&lt;/p&gt;

&lt;p&gt;Func multiplyByThree = n =&amp;gt; n * 3;&lt;br&gt;
// Returns 12&lt;br&gt;
int outcome = multiplyByThree(4);&lt;/p&gt;

&lt;p&gt;The expression n =&amp;gt; n * 3 is an example of a lambda expression. The =&amp;gt; operator is known as the "lambda operator". In this example, n is an input parameter to the anonymous method, and the return value of this function is n * 3. Thus, when multiplyByThree is called with a parameter of 4, the outcome is 3 * 4, that is 12.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q17. Is serialisation of hashtables possible?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ans. Hashtable is a collection of key-value pairs. It is not possible to serialize hashtables as the .NET Framework does not support the serialization of those objects that implement the IDictionary interface. The XmlSerializer class will show an error each time an attempt is made to serialize a Hashtable.&lt;/p&gt;

&lt;p&gt;C# interview questions for experienced candidates are usually designed in a way that can fetch more targeted answers and garner better perspectives. This is done to see if you're the right candidate for the role that's been offered. Here's a comprehensive set of important &lt;a href="https://www.interviewbit.com/c-sharp-interview-questions/" rel="noopener noreferrer"&gt;interview questions&lt;/a&gt; covererd on C#.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>career</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>HashMap Interview Questions and Answers in Java</title>
      <dc:creator>Sonia Mathias</dc:creator>
      <pubDate>Fri, 05 Mar 2021 09:43:24 +0000</pubDate>
      <link>https://dev.to/soniajm/hashmap-interview-questions-and-answers-in-java-1379</link>
      <guid>https://dev.to/soniajm/hashmap-interview-questions-and-answers-in-java-1379</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Hashmap?&lt;/strong&gt;&lt;br&gt;
Hashmaps store items in key-value pairs. It is part of the Java collection. It extends AbstractMap class and implements the map interface and is found in java.util package. The most important condition of the hashmap is that the key-value pair should be unique. If there are any duplicates found in the key then the latest value will overwrite the previous value. You can perform operations like insertion, deletion, updation, etc. in hashmaps.&lt;/p&gt;

&lt;p&gt;In the end, we will also discuss some of the commonly asked interview questions. You can also refer to this &lt;a href="https://www.interviewbit.com/data-structure-interview-questions/"&gt;link&lt;/a&gt; for more data structure-related interview questions.&lt;/p&gt;

&lt;p&gt;For now, let’s deep dive into Hashmap in Java. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does it work in Java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here are some points to remember for Hashmaps in Java:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It does not maintain any order.&lt;/li&gt;
&lt;li&gt;It is non-synchronized.&lt;/li&gt;
&lt;li&gt;It may contain one or more null values.&lt;/li&gt;
&lt;li&gt;Initially, the default capacity of the Java Hashmap class is 16.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The operation of storing and retrieving the object is done at a constant time, provided that the key is known. The method to store the object is put(key, value) and the method to retrieve the object is get(key).&lt;/p&gt;

&lt;p&gt;There are following parameters in Java Hashmap: &lt;br&gt;
&lt;strong&gt;K&lt;/strong&gt;: the type of keys maintained by the map&lt;br&gt;
&lt;strong&gt;V&lt;/strong&gt;: the type of values mapped.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hashmap implementation in Java&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following are the constructor in Hashmap:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. public Hashmap()&lt;/strong&gt;: This is the default constructor which creates an instance for Hashmap with an initial capacity of 16. &lt;/p&gt;

&lt;p&gt;Let’s look at an example for the same:&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.io.*; 
import java.util.*; 

class Main { 

    public static void main(String args[]) 
    { 

        HashMap&amp;lt;Character, String&amp;gt; hash_1 = new HashMap&amp;lt;&amp;gt;(); //Initialization
        HashMap&amp;lt;Integer, String&amp;gt; hash_2  = new HashMap&amp;lt;Integer, String&amp;gt;(); //Initialization
        hash_1.put('A', "apple");  //put() method
        hash_1.put('B', "ball"); 
        hash_1.put('C', "cat"); 

        hash_2.put(1, "one"); 
        hash_2.put(2, "two"); 
        hash_2.put(3, "three"); 

        System.out.println("Mappings of HashMap hash_1 are : " + hash_1); 
        System.out.println("Mappings of HashMap hash_2 are : " + hash_2); 
        System.out.println(hash_1.get('A'));
        System.out.println(hash_2.get(3));
        System.out.println(hash_1.get('D'));
    } 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mappings of HashMap hm1 are : {A=apple, B=ball, C=cat}                                                                                        
Mapping of HashMap hm2 are : {1=one, 2=two, 3=three}                                                                                          
apple                                                                                                                                         
three                                                                                                                                         
null 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. public HashMap(int capacity)&lt;/strong&gt;: This constructor specifies the initial capacity and the load factor of 0.75 (by default). It may help in avoiding rehashing if the number of mappings is known.&lt;/p&gt;

&lt;p&gt;Let’s look at an example:&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.io.*; 
import java.util.*; 

class Main { 

    public static void main(String args[]) 
    { 

        HashMap&amp;lt;Character, String&amp;gt; hash_1 = new HashMap&amp;lt;&amp;gt;(7); //Initialization
        HashMap&amp;lt;Integer, String&amp;gt; hash_2  = new HashMap&amp;lt;Integer, String&amp;gt;(5); //Initialization
        hash_1.put('A', "apple");  //put() method
        hash_1.put('B', "ball"); 
        hash_1.put('C', "cat"); 

        hash_2.put(1, "one"); 
        hash_2.put(2, "two"); 
        hash_2.put(3, "three"); 

        System.out.println("Mappings of HashMap hash_1 are : " + hash_1); 
        System.out.println("Mappings of HashMap hash_2 are : " + hash_2); 
        System.out.println(hash_1.get('A'));
        System.out.println(hash_2.get(3));
        System.out.println(hash_1.get('D'));
    } 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mappings of HashMap hm1 are : {A=apple, B=ball, C=cat}                                                                                        
Mapping of HashMap hm2 are : {1=one, 2=two, 3=three}                                                                                          
apple                                                                                                                                         
three                                                                                                                                         
null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. public HashMap(Map&amp;lt;? extends K,? extends V&amp;gt; m):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It creates an instance using the same mapping of the specified maps. &lt;/p&gt;

&lt;p&gt;Let’s see an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.io.*; 
import java.util.*; 

class Main { 
    public static void main(String args[]) 
    { 
        Map&amp;lt;Character, String&amp;gt; h1 = new HashMap&amp;lt;&amp;gt;(); 
        h1.put('A', "apple"); 
        h1.put('B', "ball"); 
        h1.put('C', "cat");
        h1.put('D', "dog");
        HashMap&amp;lt;Character, String&amp;gt; h2 = new HashMap&amp;lt;Character, String&amp;gt;(h1); 
        System.out.println("Mappings of HashMap h1 are : " + h1); 
        System.out.println("Mappings of HashMap h2 are : " + h2); 
    } 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mappings of HashMap h1 are : {A=apple, B=ball, C=cat, D=dog}                                                                                 
Mappings of HashMap h2 are : {A=apple, B=ball, C=cat, D=dog}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. public Hashmap(int initialCapacity, float loadFactor):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This constructor creates an instance with the specified initial capacity and the load factor. Let’s see an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.io.*; 
import java.util.*; 

class Main { 
    public static void main(String args[]) 
    { 
        HashMap&amp;lt;Character, String&amp;gt; h1 = new HashMap&amp;lt;&amp;gt;(3, 0.80f); 
        HashMap&amp;lt;Character, String&amp;gt; h2 = new HashMap&amp;lt;Character, String&amp;gt;(3, 0.5f); 
        h1.put('A', "Apple"); 
        h1.put('B', "Ball"); 
        h2.put('C', "Cat"); 
        h2.put('D', "Dog"); 
        System.out.println("Mappings of HashMap h1 are : " + h1); 
        System.out.println("Mapping of HashMap h2 are : " + h2); 
    } 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mappings of HashMap h1 are : {A=Apple, B=Ball}                                                                                                
Mapping of HashMap h2 are : {D=Dog, C=Cat} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Interview Questions in Hashmaps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.What do you mean by load factor?&lt;/p&gt;

&lt;p&gt;It is the measure of how much rehashing is to be done. It is initially kept higher so rehashing doesn’t take place, but this also increases the iteration time. The most common load factor value is 0.75. It varies from 0- 1.&lt;/p&gt;

&lt;p&gt;2.Is it possible to use any custom object as a key in Hashmap?&lt;/p&gt;

&lt;p&gt;Yes, we can use the custom object as a key in a hashmap by implementing hashcode() and equals() in the custom class. But the condition is that the hashcode should not vary once the object is inserted in the map.&lt;/p&gt;

&lt;p&gt;3.Hashmap handles collisions in Java. Justify.&lt;/p&gt;

&lt;p&gt;The java.util.Hashmap class in Java uses the approach of chaining to handle collisions. In chaining, if the new values with the same key are attempted to be pushed, then these values are stored in a linked list stored in a bucket of the key as a chain along with the existing value. In the worst-case scenario, it can happen that all keys might have the same hashcode, which will result in the hash table turning into a linked list. In this case, searching a value will take O(n) complexity as opposed to O(1) time due to the nature of the linked list. Hence, care has to be taken while selecting hashing algorithms.&lt;/p&gt;

&lt;p&gt;4.What will happen if two different HashMap key objects have the same hashcode?&lt;/p&gt;

&lt;p&gt;They will be stored in the same bucket but no next node of the linked list. And keys equals () method will be used to identify the correct key-value pair in HashMap.&lt;/p&gt;

&lt;p&gt;5.What are things an object needs to be used as a key or value in the Hashmap?&lt;/p&gt;

&lt;p&gt;The key and value along with its implementation should have the two functions hashcode() and equals(). The function that has the name of hashcode() is used when we insert the value of the key in any HashMap. At the same time, the function of equals() is called only when we are trying to get back the value that was already stored in the HashMap.&lt;/p&gt;

&lt;p&gt;6.Can we use Hashmaps in the case where we need to store null values?&lt;/p&gt;

&lt;p&gt;Yes, you can use the hashmaps to store null values without any issues. You can store one or multiple null values as per the requirement.&lt;/p&gt;

&lt;p&gt;7.How can you handle null keys in hashmaps?&lt;/p&gt;

&lt;p&gt;There are two separate methods for that putForNullKey(V value) and getForNullKey().  Null keys always map to index 0. The equals() and hashcode() methods are not used in the case of null keys in HashMap.&lt;/p&gt;

&lt;p&gt;Here is how nulls are retrieved from HashMap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private V get_null_key() {
       if (size == 0) {
            return null;
        }
        for (Entry&amp;lt;K,V&amp;gt; a = table[0]; a != null; a = a.next) {
            if (a.key == null)
                return a.value;
        }
        return null;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8.Is it possible to store multiple values under the same key using Java Hashmaps?&lt;/p&gt;

&lt;p&gt;No, you will not be able to store duplicate keys in the hashmap. If you try to store a new value in a key already present in the hashmap, then the hashmap would simply remove the value that was earlier stored in that key and replace it with the new one.&lt;br&gt;
The size of the hashmap, in this case, would not change, meaning there will be no addition of keys into the hashmap. This feature is one of the reasons we use the function keyset() to get back all the keys of a hashmap and that this function returns a set and not a collection (because in a set all the values have to be unique).&lt;/p&gt;

&lt;p&gt;9.What is the difference between hashmap and hashtable?&lt;br&gt;
HashTable is synchronized and HashMap is not. HashTable is a legacy class (part of JDK 1.0) that was promoted into collections framework by implementing Map interface later. It still has some extra features like Enumerator with it, which HashMap lacks. HashMap supports null keys (mapped to zero bucket), HashTable does not support null keys and throws NullPointerException for such cases.&lt;/p&gt;

&lt;p&gt;10.List at least 10 methods in Java Hashmaps.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;void clear()&lt;/th&gt;
&lt;th&gt;Remove all mappings from the map.&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;boolean isEmpty()&lt;/td&gt;
&lt;td&gt;Return true if this map contains no key-value mappings.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Object clone()&lt;/td&gt;
&lt;td&gt;Return a shallow copy of this HashMap instance: the keys and values themselves are not cloned.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Set entrySet()&lt;/td&gt;
&lt;td&gt;Return a collection view of the mappings contained in this map.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Set keySet()&lt;/td&gt;
&lt;td&gt;Return a set view of the keys contained in this map.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V put(Object key, Object value)&lt;/td&gt;
&lt;td&gt;It is used to insert an entry in the map.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;void putAll(Map map)&lt;/td&gt;
&lt;td&gt;Insert the specified map in the map.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V putIfAbsent(K key, V value)&lt;/td&gt;
&lt;td&gt;Inserts the specified value with the specified key in the map only if it is not already specified.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V remove(Object key)&lt;/td&gt;
&lt;td&gt;Delete an entry for the specified key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;boolean remove(Object key, Object value)&lt;/td&gt;
&lt;td&gt;Removes the specified values with the associated specified keys from the map.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Annotations in Java</title>
      <dc:creator>Sonia Mathias</dc:creator>
      <pubDate>Thu, 25 Feb 2021 14:21:37 +0000</pubDate>
      <link>https://dev.to/soniajm/annotations-in-java-2og5</link>
      <guid>https://dev.to/soniajm/annotations-in-java-2og5</guid>
      <description>&lt;p&gt;&lt;strong&gt;What are Annotations?&lt;/strong&gt;&lt;br&gt;
Annotations provide auxiliary information about the program. It can be attached with classes, interfaces, methods, constructors to provide additional information which is helpful to JVM and java compilers. It does not affect the execution of the code. It was firstly implemented in Java 5. They are started with ‘@’. &lt;/p&gt;

&lt;p&gt;Java Annotations are categorised into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Built-in Annotations&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Java provides some built-in annotations imported from java.lang:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;1) &lt;code&gt;@Override:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Shape{  
    void findArea(){
        System.out.println("finding area");
    }  
}  

    class Square extends Shape{  
        @Override  
        void findArea(){
            System.out.println("finding area of a square");

        }
    }  

    class Main{  
        public static void main(String args[]){  
        Shape sh = new Square();  
        sh.findArea();  
    }
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;finding area of a square
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) &lt;code&gt;@SuppressWarnings:&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This annotation is used to stop the compiler from showing warnings. These are of two categories: deprecation and unchecked.&lt;/p&gt;

&lt;p&gt;Here is the demo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.*;  
class Main{  
    @SuppressWarnings("unchecked")  
    public static void main(String args[]){  
        ArrayList arr=new ArrayList();  
        arr.add("abc");  
        arr.add("def");  
        arr.add("ghi");  

        for(Object obj:arr)  
        System.out.println(obj);  
    }
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we remove the SuppressWarnings annotation then the compiler will generate a warning stating that “Main.java uses unchecked or unsafe operations” because we didn’t specify the type of ArrayList as they are generic in nature.&lt;/p&gt;

&lt;p&gt;3) &lt;code&gt;@Deprecated:&lt;/code&gt;&lt;br&gt;
This annotation states that the marked element can no longer be used. If the element is used, then the compiler will generate a warning for the same. It is used to give a message that the deprecated methods may no longer be used in future versions. &lt;/p&gt;

&lt;p&gt;Here is the demo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Base{  
    void non_deprecated(){
        System.out.println("hello m");
    }   
    @Deprecated  
    void deprecated(){
        System.out.println("hello n");
    }  
}   
class Main{  
    public static void main(String args[]){  
    Base obj = new Base();  
    obj.deprecated();  
    }
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Main.java uses or overrides a deprecated API.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before proceeding towards other built-in annotations, let’s take a look at what are custom annotations.&lt;/p&gt;

&lt;p&gt;It also provides four built-in annotations from java.lang.annotations, these built-in annotations are used in custom annotations also known as Meta Annotations.&lt;/p&gt;

&lt;p&gt;1) &lt;code&gt;@Retention:&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It specifies how long the annotation will be in use. It has following options:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RetentionPolicy.CLASS&lt;/code&gt; : retained by the compiler and ignored by the JVM.&lt;br&gt;
&lt;code&gt;RetentionPolicy.SOURCE&lt;/code&gt; : retained at source level and ignored by the compiler&lt;br&gt;
&lt;code&gt;RetentionPolicy.RUNTIME&lt;/code&gt; : retained by the JVM and used at the runtime &lt;br&gt;
Environment.&lt;/p&gt;

&lt;p&gt;(RetentionPolicy is the parameter of &lt;code&gt;@Retention&lt;/code&gt; annotation.)&lt;/p&gt;

&lt;p&gt;2) &lt;code&gt;@Documented:&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It specifies that the marked element needs to be documented by JavaDoc. &lt;br&gt;
For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.lang.annotation.*;

@Documented
@interface Example {

   // Annotation element definitions

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will make the information appear in @Example to JavaDocs.&lt;/p&gt;

&lt;p&gt;3) &lt;code&gt;@Target:&lt;/code&gt;&lt;br&gt;
It indicates where the annotation is to be used. For eg. if the type is specified as TYPE then the annotation is to be used in class or interface. &lt;/p&gt;

&lt;p&gt;There are following target values for the annotation:&lt;/p&gt;

&lt;p&gt;ElementType.METHOD for methods&lt;br&gt;
ElementType.PACKAGE for packages&lt;br&gt;
ElementType.PARAMETER for parameters&lt;br&gt;
ElementType.TYPE for class, interfaces&lt;br&gt;
ElementType.ANNOTATION_TYPE for annotation type&lt;br&gt;
ElementType.CONSTRUCTOR for constructors&lt;br&gt;
ElementType.LOCAL_VARIABLE for local variables&lt;br&gt;
ElementType.FIELD for fields&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})  
@interface AnnotationExample{  
    int value_1();  
    String value_2();  
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code specifies the annotation for class, fields and methods.&lt;/p&gt;

&lt;p&gt;4) &lt;code&gt;@Inherited:&lt;/code&gt;&lt;br&gt;
It specifies that the marked element can be inherited from the superclass.&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java.lang.annotation.Inherited

@Inherited
public @interface AnnotationExample {

}
@AnnotationExample
public class Base { 
  //Base class body
}
public class Child extends Base { 
   //Child class body
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the class Base is using annotation @AnnotationExample which is marked with @inherited annotation. It means the sub-class Child inherits the @AnnotationExample.&lt;/p&gt;

&lt;p&gt;Some annotations were introduced in Java 9, here is the list below:&lt;br&gt;
1)&lt;code&gt;@Repeatable:&lt;/code&gt;It came in Java SE 8 and signifies that the marked annotation can be used more than once to the same declaration or type use.&lt;/p&gt;

&lt;p&gt;Let’s suppose you want an annotation to be repeated like in the below example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@interface Month {
  String name();
}
@Month(name = "january")
@Month(name = "march")
@Month(name = "june")
@Month(name = "october")//@Month annotation repeated 4 times
class Birthday {
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Till Java 7 this kind of program used to produce an error but from Java 8 the concept of repeating annotation got accepted but there is a certain way to achieve it. &lt;/p&gt;

&lt;p&gt;Let’s see how:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
 @Repeatable(Months.class)
 @interface Month {
   String name();
 }
 @Retention(RetentionPolicy.RUNTIME)
 @interface Months {
   Month[] value();
 }
 @Month(name = "january") @Month(name = "march") @Month(name = "june") @Month(name = "october")
 class Birthday {
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, Months is the Container Annotation.&lt;/p&gt;

&lt;p&gt;To use the above annotations, do as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class RepeatingAnnotations {
  public static void main(String args[]) {
   Month[] monthArray = Birthday.class.getAnnotationsByType(Month.class);
   for (Month month : monthArray) {
    System.out.println(month.name());
   }
  }
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;january
march
june
october
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) &lt;code&gt;@SafeVarargs:&lt;/code&gt;&lt;br&gt;
This annotation was introduced in Java 7 and additional features came upto Java 9. It can be used with final methods, constructors, static methods and private instance methods. This annotation makes sure that the method does not perform any unsafe operations on its varargs parameters. One important thing about this annotation is that it cannot be applied to overridden methods but can be applied otherwise.&lt;/p&gt;

&lt;p&gt;3) &lt;code&gt;@FunctionalInterface:&lt;/code&gt;&lt;br&gt;
This annotation was introduced in Java 8. It allows only one abstract method inside them, due to this feature, they are also known as Single Abstract Method interfaces (SAM interfaces). If this rule is violated, the compiler will generate an error.&lt;/p&gt;

&lt;p&gt;Let’s see an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@FunctionalInterface
interface Rectangle 
{ 
    int calc_area(int x, int y); 
} 

class Main 
{ 
    public static void main(String args[]) 
    { 
        int a = 5; 
        int b = 6;


        // lambda expression to define the calculate method 
        Rectangle r = (int x, int y)-&amp;gt;x*y; 

        // parameter passed and return type must be 
        // same as defined in the prototype 
        int result = r.calc_area(a,b); 
        System.out.println(result); 
    } 
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Custom Annotations&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can create custom annotations using &lt;code&gt;@interface&lt;/code&gt; along with the name of the annotation. These annotations can have elements but should not have the implementation of these elements.&lt;br&gt;
&lt;code&gt;@Documented&lt;/code&gt;, &lt;code&gt;@Inherited&lt;/code&gt;, &lt;code&gt;@Target&lt;/code&gt;, &lt;code&gt;@Retention&lt;/code&gt; are some of the annotations that are used with the custom annotations.&lt;/p&gt;

&lt;p&gt;Here is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.ArrayList;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;



@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)

@interface CustomAnnotation{
    String name();
    int emp_id();
}

@CustomAnnotation(name="John",emp_id=101)
class Employee{
    String dept_name;
    int dept_id;

    public Employee(String dept_name, int dept_id){
        super();
        this.dept_name = dept_name;
        this.dept_id = dept_id;
    }
}

public class Main{
    public static void main(String[] args){
        Employee obj = new Employee("IT", 111);

        Class c = obj.getClass();
        Annotation an = c.getAnnotation(CustomAnnotation.class);
        CustomAnnotation ca = (CustomAnnotation)an;
        System.out.println(ca.name());

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What are the Types of Java Annotations?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These are the types of annotations:&lt;br&gt;
1) &lt;strong&gt;Marker Annotations:&lt;/strong&gt; Annotations having no methods are marker annotations, for eg: @Override and &lt;a class="mentioned-user" href="https://dev.to/deprecated"&gt;@deprecated&lt;/a&gt;
.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@interface AnnotationExample { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) &lt;strong&gt;&lt;em&gt;Single-valued annotations:&lt;/em&gt;&lt;/strong&gt; Annotation having one method are single-valued annotations, here is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@interface AnnotationExample {
    int item();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to provide a default value, then,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@interface AnnotationExample {
    int item() default 100;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3) &lt;strong&gt;&lt;em&gt;Multi-valued annotations:&lt;/em&gt;&lt;/strong&gt; Annotations having more than one method are multi-valued annotations, &lt;/p&gt;

&lt;p&gt;here is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@interface AnnotationExample {
    int item1();
    int item2();
    String item3();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@interface AnnotationExample {
    int item1() default 1;
    int item2() default “abc”;
    String item3() default “Hello”;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Commonly Asked Interview Questions on Java Annotation&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Annotations in Java has been one of the important concepts to help prepare for any Java interview. Here's a detailed &lt;a href="https://www.interviewbit.com/java-interview-questions/"&gt;interview questions&lt;/a&gt; guide that will help you in your Java Interview preparation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. What are meta-annotations in java, list some of them?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Meta-Annotations are annotations that are applied to other annotations. Below is the list of meta-annotations in Java:&lt;br&gt;
@Documented&lt;br&gt;
@Retention&lt;br&gt;
@Inherited&lt;br&gt;
@Target&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. What is the parent class of the Annotation class?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Object&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. What is the package name for Annotation class?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java.text&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Why are annotations used?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They are used to give certain instructions to the compiler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What are the typical use cases of Annotations?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Information for the compiler – with annotations, the compiler can detect errors or suppress warnings.&lt;/p&gt;

&lt;p&gt;Compile-time and deployment-time processing – software tools can process annotations and generate code, configuration files, etc.&lt;br&gt;
Runtime processing – annotations can be examined at runtime to customize the behavior of a program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. What object types can be returned from a method annotation declaration?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The return type must be a primitive, String, Class, Enum, or an array of one of the previous types. Otherwise, the compiler will throw an error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Is it possible to extend annotations?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. Annotations always extend java.lang.annotation.Annotation, as stated in the Java Language Specification.&lt;br&gt;
If we try to use the extends clause in an annotation declaration, we'll get a compilation error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Name 5 pre-defined annotations in Java.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;@SuppressWarnings&lt;/code&gt;&lt;br&gt;
&lt;code&gt;@Deprecated&lt;/code&gt;&lt;br&gt;
&lt;code&gt;@Override&lt;/code&gt;&lt;br&gt;
&lt;code&gt;@SafeVarargs&lt;/code&gt;&lt;br&gt;
&lt;code&gt;@FuntionalInterface&lt;/code&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
