In this article, we will learn how to implement Python Sieve of Eratosthenes to find Prime Numbers. Sieve of Eratosthenes is an ancient algorithm used to find the prime numbers up to any given limit and it is one of the efficient ways to find prime numbers. … [Read more...]
Python Data Types | Immutable & Mutable Types
In this article, we will learn about Python Data Types. Data types represent the type of data stored in a variable. Since Python is a dynamically typed language, there is no need to declare the data type during declaration explicitly, and the Python interpreter automatically assigns the value to its type. Below are the built-in data types available in Python Boolean … [Read more...]
8 Different Ways to Merge Two Dictionaries in Python
In this article, we will discuss the different ways to merge two dictionaries in Python. Python dictionary is an unordered collection of items. We will be using the below approaches to merge two dictionaries update() method copy() and update() method ** operator dict() constructor dict() with **kwargs Concatenation in dict() collections - ChainMap … [Read more...]
Top 80 Spring Interview Questions
1. What is Spring Framework? Spring is an open-source framework created to address the complexity of building enterprise applications. It eases the development effort by providing IOC container, Dependency Injection, Aspect-oriented programming, etc. Spring framework also allows you to connect to other frameworks such as Struts, EJB, Hibernate, etc. 2. What are the advantages … [Read more...]
Python Numbers – Integers, Floating-Point, and Complex Numbers
Python Numbers can be classified into three types Integers, Floating-point, and Complex numbers, and there is no explicit type declaration needed in Python. The numbers which we type in will be automatically interpreted as a number. … [Read more...]
How to get the Iteration index in for loop in Python
In this article, we will learn how to get the iteration index in for loop in Python. In Python, we usually iterate a for loop with the in operator or range() function. If suppose you are iterating a list of 5 elements and you want to perform some special operation on the 3rd element, how do you do it in Python? … [Read more...]
Types of Exceptions in Java – Checked, Unchecked, & Error
In this article, we will learn about the different types of exceptions in Java checked exceptions, unchecked exceptions, and errors. … [Read more...]
Python *args and **kwargs – Pass multiple arguments to a function
In this article, let's learn about Python *args and **kwargs and its functionality. *args and **kwargs are often used as parameters in function definitions enabling us to pass multiple arguments to the function. *args as a parameter in function definition allows you to pass a non-keyworded, variable-length tuple to the calling function. **kwargs as a parameter in function … [Read more...]
Python Comments – Single Line and Multi Line Comments
Comments are a handy tool for programmers and considered as one of the best practices for developers. Even though comments will not alter the execution flow or change the outcome of the code, it improves the readability of the code and helps you to understand why a particular block of code was written at a later point. In this article, we will learn about Python Comments, both … [Read more...]
Python Hello World Program
Python is a simple, easy to learn yet powerful programming language. Guido van Rossum created Python and released in 1991. Python is so simple as there are no type declarations of variables, parameters, functions in the code, which makes the code short and flexible. In simple words, we can say Python drives the current world software development by providing libraries for … [Read more...]
40 Pattern Programs in Java – Number, Star, Alphabet Patterns
In this article, we will learn to print the different Pattern Programs in Java, it is the most famous interview question as it tests our logical skills and understanding of flow control. Let's look into the below possible Pattern Programs in Java which includes Number patterns, Star patterns, and Alphabet patterns. … [Read more...]
Fail-Fast and Fail-Safe Iterators in Java
An iterator enables us to iterate the objects in a collection, and the iterator can be either Fail-Safe or Fail-Fast. The Fail-Fast iterator will throw ConcurrentModificationException whenever we modify the collection during iteration. On the other hand, Fail-Safe iterator will not throw ConcurrentModificationException even when we modify the collection during iteration. In … [Read more...]
- « Previous Page
- 1
- 2
- 3
- 4
- …
- 31
- Next Page »