Java example

Java tutorials for Beginners – Java ByteArrayInputStream Class

Hits: 10 (Java programming Example for Beginners) Java ByteArrayInputStream Class In this tutorial, we will learn about Java ByteArrayInputStream and its methods with the help of examples. The ByteArrayInputStream class of the java.io package can be used to read an array of input data (in bytes). It extends the InputStream abstract class. Note: In ByteArrayInputStream, the input stream is created using the …

Java tutorials for Beginners – Java FileInputStream Class

Hits: 6 (Java programming Example for Beginners) Java FileInputStream Class In this tutorial, we will learn about Java FileInputStream and its methods with the help of examples. The FileInputStream class of the java.io package can be used to read data (in bytes) from files. It extends the InputStream abstract class. Before we learn about FileInputStream, make sure to know about Java Files. Create …

Python Example – Write a Python program to create a simple math quiz

Hits: 20 (Python Example for Beginners)   Write a Python program to create a simple math quiz.   Sample Solution: Python Code: import random def display_intro(): title = “** A Simple Math Quiz **” print(“*” * len(title)) print(title) print(“*” * len(title)) def display_menu(): menu_list = [“1. Addition”, “2. Subtraction”, “3. Multiplication”, “4. Integer Division”, “5. …

Java tutorials for Beginners – Java ListIterator

Hits: 6 (Java programming Example for Beginners) Java ListIterator Interface In this tutorial, we will learn about the Java ListIterator interface with the help of an example. The ListIterator interface of the Java collections framework provides the functionality to access elements of a list. It is bidirectional. This means it allows us to iterate elements of a …

Java tutorials for Beginners – Java Iterator

Hits: 3 (Java programming Example for Beginners) Java Iterator Interface In this tutorial, we will learn about the Java Iterator interface with the help of an example. The Iterator interface of the Java collections framework allows us to access elements of a collection. It has a subinterface ListIterator. All the Java collections include an iterator() method. This method returns an …

Java tutorials for Beginners – Java Algorithms

Hits: 4 (Java programming Example for Beginners) Java Algorithms In this tutorial, we will learn about different algorithms provided by the Java collections framework with the help of examples. The Java collections framework provides various algorithms that can be used to manipulate elements stored in data structures. Algorithms in Java are static methods that can …

Java tutorials for Beginners – Java TreeSet

Hits: 28 (Java programming Example for Beginners) Java TreeSet In this tutorial, we will learn about the Java TreeSet class and its various operations and methods with the help of examples. The TreeSet class of the Java collections framework provides the functionality of a tree data structure. It extends the NavigableSet interface. Creating a TreeSet In order to …

Java tutorials for Beginners – Java SortedSet Interface

Hits: 27 (Java programming Example for Beginners) Java SortedSet Interface In this tutorial, we will learn about the SortedSet interface in Java and its methods with the help of an example. The SortedSet interface of the Java Collections framework is used to store elements with some order in a set. It extends the Set interface. Class that implements …

Java tutorials for Beginners – Java LinkedHashSet

Hits: 20 (Java programming Example for Beginners) Java LinkedHashSet In this tutorial, we will learn about the Java LinkedHashSet class and its methods with the help of examples. The LinkedHashSet class of the Java collections framework provides functionalities of both the hashtable and the linked list data structure. It implements the Set interface. Elements of LinkedHashSet are stored in hash …

Java tutorials for Beginners – Java HashSet Class

Hits: 23 (Java programming Example for Beginners) Java HashSet Class In this tutorial, we will learn about the Java HashSet class. We will learn about different hash set methods and operations with the help of examples. The HashSet class of the Java Collections framework provides the functionalities of the hash table data structure. It implements the Set interface. …

Java tutorials for Beginners – Java ConcurrentHashMap

Hits: 21 (Java programming Example for Beginners) Java ConcurrentHashMap In this tutorial, we will learn about the Java ConcurrentHashMap class and its operations with the help of examples. The ConcurrentHashMap class of the Java collections framework provides a thread-safe map. That is, multiple threads can access the map at once without affecting the consistency of entries in …

Java tutorials for Beginners – Java LinkedHashMap

Hits: 31 (Java programming Example for Beginners) Java LinkedHashMap In this tutorial, we will learn about the Java LinkedHashMap class and its operations with the help of examples. The LinkedHashMap class of the Java collections framework provides the hash table and linked list implementation of the Map interface. The LinkedHashMap interface extends the HashMap class to store its entries in a hash …

Java tutorials for Beginners – Java LinkedBlockingQueue

Hits: 26 (Java programming Example for Beginners) Java LinkedBlockingQueue In this tutorial, we will learn about the LinkedBLockingQueue class and its methods with the help of examples. The LinkedBlockingQueue class of the Java Collections framework provides the blocking queue implementation using a linked list. It implements the Java BlockingQueue interface. Creating LinkedBlockingQueue In order to create a linked blocking queue, …

Java tutorials for Beginners – Java ArrayBlockingQueue

Hits: 27 (Java programming Example for Beginners) Java ArrayBlockingQueue In this tutorial, we will learn about the ArrayBlockingQueue class and its methods with the help of examples. The ArrayBlockingQueue class of the Java Collections framework provides the blocking queue implementation using an array. It implements the Java BlockingQueue interface. Creating ArrayBlockingQueue In order to create an array blocking …