Differences between Interface and class in Java

Mahesh Parahar
Updated on 07-Dec-2023 11:54:40

16K+ Views

Class A class is a blueprint from which individual objects are created. A class can contain any of the following variable types. Local Variables − Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and the variable will be destroyed when the method has completed. Instance Variables − Instance variables are variables within a class but outside any method. These variables are initialized when the class is instantiated. Instance variables can be accessed from inside any method, constructor or blocks of that particular class. Class Variables − Class variables are variables declared ... Read More

Difference Between LinkedList and LinkedHashSet in Java

Nitin Sharma
Updated on 07-Dec-2023 11:12:55

1K+ Views

LinkedList and LinkedHashSet both are one of the most important classes of Java Collection framework. Following are the important differences between LinkedList and LinkedHashSet. Sr. No. Key LinkedList LinkedHashSet 1 Implementation LinkedList is the implementation of list and deque interface. LinkedHashSet on other hand is the implementation of set interface and it inherits Hashset class. 2 Internal Implementation LinkedList internally implements or we can say uses doubly linked list to store the elements. LinkedHashSet on other hand internally uses LinkedHashMap to store it’s elements. 3 Order of Elements As LinkedList internally used doubly linked list so we can add or remove elements from both ends in case of linkedlist. While LinkedHashset has Hashmap internally so elements could ... Read More

Differences between ArrayList and LinkedList in Java

Mahesh Parahar
Updated on 07-Dec-2023 10:15:10

21K+ Views

Both ArrayList and LinkedList are implementation of List interface in Java. Both classes are non-synchronized. But there are certain differences as well. Following are the important differences between ArrayList and LinkedList method. Sr. No. Key ArrayList LinkedList 1 Internal Implementation ArrayList internally uses a dynamic array to store its elements. LinkedList uses Doubly Linked List to store its elements. 2 Manipulation ArrayList is slow as array manipulation is slower. LinkedList is faster being node based as not much bit shifting required. 3 Implementation ArrayList implements only List. LinkedList implements List as well as Queue. It can acts as a queue as well. 4 Access ArrayList is faster in storing and accessing data. LinkedList is faster in manipulation of data. Example of ArrayList ... Read More

Pattern UNICODE_CASE field in Java with Examples

Maruthi Krishna
Updated on 07-Dec-2023 10:03:09


Enables Unicode-aware case folding. When you use this as flag value to the compile() method along with the CASE_INSENSITIVE flag and if you search for Unicode characters using regular expressions Unicode characters of both cases will be matched. Example import java.util.regex.Matcher; import java.util.regex.Pattern; public class UNICODE_CASE_Example { public static void main( String args[] ) { String regex = "\u00de"; //Compiling the regular expression Pattern pattern = Pattern.compile(regex, Pattern.UNICODE_CASE|Pattern.CASE_INSENSITIVE); //Retrieving the matcher object String str[] = {"\u00de", "\u00fe", ... Read More

Pattern UNIX_LINES field in Java with Examples

Maruthi Krishna
Updated on 07-Dec-2023 09:56:32


This flag enables Unix lines mode. In the Unix lines mode, only '' is used as a line terminator and ‘\r’ is treated as a literal character. Example 1 import java.util.regex.Matcher; import java.util.regex.Pattern; public class LTERAL_Example { public static void main(String[] args) { String input = "This is the first line\r" + "This is the second line\r" + "This is the third line\r"; //Regular expression to accept date in MM-DD-YYY format ... Read More

Tkinter difference between <event> and <<event>>

Gaurav Leekha
Updated on 06-Dec-2023 16:52:10


Graphical User Interfaces (GUIs) play a vital role in modern software applications, allowing users to interact with programs through intuitive visual elements. Tkinter, the de facto standard GUI toolkit for Python, provides a robust set of tools and widgets to build GUI applications. In Tkinter, event handling is a fundamental concept, allowing developers to respond to user actions such as button clicks, key presses, and mouse movements. Two commonly used event formats in Tkinter are and . In this article, we will explore the differences between these two event formats and discuss their appropriate use cases. The Format The format ... Read More

What are the parameters of configure method of tkinter/tk()?

Gaurav Leekha
Updated on 06-Dec-2023 15:16:10


The Tkinter library is a popular tool for building graphical user interfaces (GUIs) in Python. It provides a variety of methods and functionalities to create and customize GUI applications. One of the essential methods in Tkinter is the configure() method, which allows you to modify the parameters of a widget. In this article, we will explore the parameters of the configure() method in Tkinter and understand how they can be used to customize the appearance and behavior of widgets. The configure() method is used to modify the attributes or options of a widget in Tkinter. It is a versatile method that ... Read More

What is Tkinter’s tkapp?

Gaurav Leekha
Updated on 06-Dec-2023 15:12:47


Tkinter is a standard Python library for creating graphical user interfaces (GUIs). It provides a set of tools and widgets for building interactive desktop applications with Python. One of the most important components of Tkinter is the tkapp, which is the root object of the Tkinter application. What is Tkinter's tkapp? The tkapp is the main object of the Tkinter application. It represents the root window of the application, which is the top-level window that contains all other windows, widgets, and controls in the application. The tkapp is created using the Tk() function, which is a constructor for the tkapp ... Read More

Undo and Redo in a Tkinter Entry Widget

Gaurav Leekha
Updated on 06-Dec-2023 15:10:12


When developing graphical user interfaces (GUIs) in Python using Tkinter, it is important to provide users with efficient and intuitive editing capabilities, including the ability to undo and redo changes made in text entry fields. While Tkinter's Entry widget does not natively support undo and redo functionality, we can implement it using a slightly different approach. In this article, we will explore how to incorporate undo and redo operations in a Tkinter Entry widget using the built-in Text widget and customizing its behavior. Understanding the Entry Widget in Tkinter: Before we dive into the implementation details, let's first understand ... Read More

Table of widgets in Python with Tkinter

Gaurav Leekha
Updated on 06-Dec-2023 15:08:05


Tkinter is a popular library in Python for creating graphical user interfaces (GUIs). It provides a wide range of widgets that can be used to build interactive and visually appealing applications. One of the key features of Tkinter is the ability to create tables or grids of widgets. In this article, we will explore how to create a table of widgets using Tkinter and demonstrate some useful techniques. Tkinter provides a widget called Frame that serves as a container for other widgets. We can use frames to create a table-like structure by arranging multiple frames in rows and columns. Each ... Read More

1 2 3 4 5 ... 11552 Next