
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7442 Articles for Java

737 Views
The protected and package access modifiers determine how a member of a class or method can be accessed. The modifiers are attached to the members at the time of declaration. We know that these access modifiers play a major role in Java oops concepts like encapsulation, polymorphism and inheritance. It helps in preventing misuse of functionalities provided by a member. We will try to understand protected and package access modifiers in Java through example programs. Access Modifiers in Java Protected Access Modifier It is mostly used in the case of inheritance to control the access of parent class members ... Read More

1K+ Views
The protected and final access modifiers determine how a member of a class or method can be accessed. The modifiers are attached to the members at the time of declaration. We know that these access modifiers play a major role in Java oops concepts like encapsulation and inheritance. It helps in preventing misuse of functionalities provided by a member. We will try to understand protected and final access modifiers in Java through example programs. Access Modifiers in Java Protected Access Modifier It is mostly used in the case of inheritance to control the access of parent class members and ... Read More

4K+ Views
JSP stands for Java Server Pages and is used for the purpose of developing web based applications. A single JSP page consists of HTML tags for static content and JSP tags to construct dynamic content. The JSP tags start with ‘’. We save our JSP file with the extension ‘.jsp’. Validating a user means simply checking whether the user has entered correct login details or not. The validation process in JSP is quite simple and straightforward. This article will guide you to create a program to validate a user using JSP. Steps to create a Program to Validate a ... Read More

570 Views
ReetrantLock is a class that implements Lock Interface. It provides the synchronization feature with great flexibility which is why it is the most used lock class in Java. It is necessary for the reliable and fair working of thread. Here, threads are small sub-processes of a big operation. In this article, we are going to learn ReetrantLock and how they manage threads so that they can work efficiently. Working of ReetrantLock When multiple threads try to access a shared resource then, ReetrantLock restricts access to a single thread at a time through ‘lock()’ and ‘unlock()’ methods. Suppose there are ... Read More

11K+ Views
List is the sub-interface of Java Collection Interface. It is a linear structure that stores and accesses each element in a sequential manner. To use the features of list, we use ArrayList and LinekdList class that implements the list interface. In this article, we will create an ArrayList and try to select items from that list randomly. Program to Randomly select items from a List in Java Random Class We create an object of this class to generate pseudorandom numbers. We will customize this object and apply our own logic to select any random items from the list. ... Read More

2K+ Views
Complex numbers are expressed as the sum of a real number and an imaginary number. Its general form is ‘a + ib’ where a and b represent real numbers and ‘i’ an imaginary number. For example, 5.4 + 2.6i here, 5.4 is the real part and 2.6i is the imaginary part. The various application of complex number includes quantum mechanics, signal processing and so forth. In this article, we will create a Java program to add and subtract complex numbers using class. Although it supports almost all the basic mathematical operations. Program to Add and Subtract Complex Numbers using ... Read More

2K+ Views
HashMap is a class that is used to implement Map Interface. It stores its element in key-value pairs. The Key is an object that is used to fetch and receive value associated with it. It has access to all the methods of Map Interface, it does not have any additional methods of its own. Duplicate values are not allowed, although we can store null values and keys. In this article, we will try reading the content of a local text file into Java HashMap. Java Program to Read Text File into Java HashMap The general syntax for HashMap is as ... Read More

2K+ Views
Recursive Constructor Invocation is a compile time error that occurs when a constructor calls itself. It is similar to recursion where a method calls itself as often as necessary. The method that calls itself is called as recursive method and the constructor that calls itself is called as recursive constructor. In this article, we will understand the Recursive Constructor Invocation error in Java with a few examples. Recursive Constructor Invocation Constructor It is quite similar to methods but the difference is that methods define the behavior of an object but constructor is used to initialize those objects. We can provide ... Read More

424 Views
Solving interesting pattern problems enhances the understanding of loops. They are essential because they help in building a strong foundation of a particular programming language. There are various kinds of patterns including number-based, star-based and alphabetical patterns as well. In this article, we will discuss a few Java programs to print interesting star patterns. Program to Print Interesting Pattern Pattern 1 Approach Declare and initialize an integer ‘n’ that specifies number of rows and columns. Define a for loop that will run till ‘n’. Inside this loop define an if-else block. The if block will print star ‘n’ ... Read More

3K+ Views
Both StAX and SAX are a type of XML parser APIs. Here, API stands for Application Programming Interface and Parser is used to read and extract content from an XML document in desired format. From this line, it is clear that StAX and SAX are used to read XML documents. APIs are a modern way to migrate real time information on the Web. In this article, we will discuss the difference between StAX and SAX Parser in Java. StAX vs SAX Parser XML Its full form is eXtensible Markup Language and it is said to be a data description language. ... Read More