Shriansh Kumar

Shriansh Kumar

211 Articles Published

Articles by Shriansh Kumar

Page 19 of 22

How to Fix int cannot be dereferenced Error in Java?

Shriansh Kumar
Shriansh Kumar
Updated on 19-Jul-2023 7K+ Views

"int cannot be dereferenced", a common error in Java that may occur while converting a variable of integer type into String or while comparing it with other primitive type variables. It might be difficult to debug for a beginner programmer, but once we get the alternative ways of converting and comparing integers, it will become a piece of cake for us. Try to stick with us till the end of this article to find the reasons and possible solutions for fixing the 'int cannot be dereferenced error'. How to Fix int cannot be dereferenced Error in Java ...

Read More

Different Ways to Capture Java Heap Dumps

Shriansh Kumar
Shriansh Kumar
Updated on 19-Jul-2023 334 Views

A heap dump is a snapshot of the memory more specifically the Java heap memory of a Java process at a certain point in time. It contains information about the Java objects and classes. Heap dumps are useful when we need to debug memory problems such as memory leaks, high memory consumption, and out of memory errors. Java provides several ways to capture these heap dumps that we are going to explore in this article. Ways to Capture Java Heap Dumps The following ways can be used to capture Java heap dumps: ...

Read More

Difference Between trustStore and keyStore in Java

Shriansh Kumar
Shriansh Kumar
Updated on 19-Jul-2023 1K+ Views

If one is a Java developer and has worked with the Java SSL/TLS, one may have encountered the terms trustStore and keyStore. These two files are used to store cryptographic keys and certificates. Till Java 8, the default format for these files was JKS. With the release of Java 9, the default format changed to PKCS12. Here, JKS is a Java specific format, whereas the PKCS12 is a language independent format. In this article, we will discuss the difference between trustStore and keyStore in Java. trustStore vs keyStore trustStore It is a file ...

Read More

Difference Between State and Strategy Design Pattern in Java

Shriansh Kumar
Shriansh Kumar
Updated on 19-Jul-2023 651 Views

Being a Java developer, one might have encountered some design patterns that help us in structuring our code and make it more reusable and maintainable. Two of these design patterns are the State pattern and the Strategy pattern. The use case of these design patterns is almost the same. However, they are different from each other in many ways. In this article, we are going to explore the differences between state and strategy design patterns in Java. State vs Strategy Design Pattern State Design Pattern The State pattern is a behavioral design pattern that allows an object ...

Read More

Difference Between RMI and DCOM

Shriansh Kumar
Shriansh Kumar
Updated on 19-Jul-2023 389 Views

Both RMI and DCOM are the technologies that serve to enable distributed object computing. The RMI is a Java-based technology, DCOM, on the other hand, is developed by Microsoft. Although they are built for the same purpose by two technical market giants, there exist some significant differences in terms of design, implementation and usage. We are going to compare and list some differences between RMI and DCOM in this article. RMI vs DCOM Distributed Objects To understand the differences between RMI and DCOM, it is necessary to understand distributed object computing as both terms come under the same umbrella. ...

Read More

Program to print interesting pattern

Shriansh Kumar
Shriansh Kumar
Updated on 16-May-2023 519 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

Program to print Hut Star pattern

Shriansh Kumar
Shriansh Kumar
Updated on 16-May-2023 885 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. This article will guide you to solve a hut star pattern using nested for loop in Java. Java Program to print Hut Star Pattern Since we are going to solve the problem using nested for loop therefore, it is necessary to discuss its syntax. Syntax for ( initial expression; conditional expression; increment/decrement expression ){ for ( ...

Read More

Public vs Protected vs Package vs Private Access Modifiers in Java

Shriansh Kumar
Shriansh Kumar
Updated on 16-May-2023 909 Views

Java has various levels of protection that allow precise control over the accessibility of member variables and methods within classes, subclasses, and packages. The access control mechanism works with the help of access modifiers such as public, protected, private and package. They define scope of a variable, class and method. We are going to understand the various access modifiers in Java. Access Modifiers in Java Public Access Modifier Java does not restrict the accessibility of public members. Anything declared public can be accessible everywhere means we can access them within the class as well as outside the class and ...

Read More

Program to validate a user using JSP

Shriansh Kumar
Shriansh Kumar
Updated on 16-May-2023 5K+ 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

Randomly select items from a List in Java

Shriansh Kumar
Shriansh Kumar
Updated on 16-May-2023 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
Showing 181–190 of 211 articles
Advertisements