Alshifa Hasnain

Alshifa Hasnain

Converting Code to Clarity

About

A professional technical content writer with Java programming skills. I have a desire to write informative and detailed Java articles for both beginner and professional developers. Having a strong background in HTML, CSS, JavaScript, Java, JDBC, JSP, Spring, and Hibernate.

221 Articles Published

Articles by Alshifa Hasnain

Page 16 of 23

Java Concurrency – join() method

Alshifa Hasnain
Alshifa Hasnain
Updated on 25-Feb-2025 659 Views

In this article, we will learn about concurrency in Java. It allows multiple threads to execute simultaneously, sharing system resources efficiently. One of the methods provided in the Thread class for managing thread execution is the join() method. What is the join() Method? the join () function is used to join the beginning of the execution of a thread to the end of the execution of another thread. This way, it is ensured that the first thread won’t run until the second thread has stopped executing. This function waits for a specific number of milliseconds for the thread to terminate. ...

Read More

JavaScript Basic Array Methods

Alshifa Hasnain
Alshifa Hasnain
Updated on 24-Feb-2025 833 Views

In this article, we will learn about different basic array methods in JavaScript. Adding and Removing Elements Some basic JavaScript array methods for adding and removing elements − Method Description ...

Read More

Java program to divide a number into smaller random ints

Alshifa Hasnain
Alshifa Hasnain
Updated on 24-Feb-2025 668 Views

In this article, we will learn to divide a number into smaller random ints in Java. Dividing a number into smaller random integers is a useful technique in various applications such as resource allocation, gaming, and randomization processes Divide a Number into Random Parts The approach relies on generating unique random dividers within the given number and then computing the differences between consecutive dividers to form the final parts.  Following are the steps to divide a number into smaller random ints in Java Create a HashSet to ...

Read More

Java DatabaseMetaData getProcedures() method with example

Alshifa Hasnain
Alshifa Hasnain
Updated on 24-Feb-2025 754 Views

In this article, we will learn the DatabaseMetaData getProcedures() method in Java. In Java, the DatabaseMetaData.getProcedures() method is used to retrieve information about stored procedures available in a database. What is getProcedures()? The getProcedures() method of the DatabaseMetaData interface returns a ResultSet containing metadata about stored procedures available in a database. This allows developers to query the database for procedure names, catalog information, procedure types, and specific names. Syntax ResultSet procedures = metaData.getProcedures(null, null, "myprocedure"); This method retrieves the description of the stored procedures of a database/catalog. It accepts 3 parameters − catalog: The catalog name ...

Read More

Is JavaScript a case sensitive language?

Alshifa Hasnain
Alshifa Hasnain
Updated on 21-Feb-2025 4K+ Views

JavaScript is a case-sensitive language. This means that the language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters. So the identifiers Time and TIME will convey different meanings in JavaScript. What Does Case-Sensitive Mean in JavaScript? Case sensitivity in programming refers to whether a language distinguishes between uppercase and lowercase letters.  For example − myVariable and myvariable are treated as two different identifiers. function and Function are not the same (the former is a keyword, while the latter could be a user-defined ...

Read More

What is the difference between JavaScript undefined and void(0)?

Alshifa Hasnain
Alshifa Hasnain
Updated on 21-Feb-2025 849 Views

In this article, we will learn the difference between JavaScript undefined and void(0). Though they may appear similar, they serve distinct purposes and can be used in different scenarios. What is JavaScript undefined? undefined means a variable declared, but no value has been assigned. It is a primitive value automatically assigned to variables that have been declared but not initialized. For Example − var demo; alert(demo); //shows undefined alert(type of demo); //shows undefined It is a global property that represents a variable with no assigned value. If a function does not return ...

Read More

When is a CDATA section necessary within a script tag?

Alshifa Hasnain
Alshifa Hasnain
Updated on 20-Feb-2025 947 Views

When working with JavaScript inside HTML documents, developers may come across the CDATA section. It can be helpful when dealing with older XHTML documents or embedded JavaScript in XML-based markup. What is a CDATA Section? A CDATA (Character Data) section is a special syntax used in XML and XHTML documents to prevent certain characters from being interpreted as markup. It ensures that special characters like < and & are treated as plain text rather than triggering parsing errors. Syntax − Why Was CDATA Used tag? To avoid parsing the symbols &, it is added in …. It ...

Read More

Java program to pass lambda expression as a method argument

Alshifa Hasnain
Alshifa Hasnain
Updated on 20-Feb-2025 648 Views

In this article, we will learn to pass a lambda expression as a method argument in Java. A lambda expression is a short block of code that takes in parameters and returns a value. Lambda Expression Lambda expressions allow passing functionality as a method parameter, reducing the need for anonymous classes. They are often used in functional interfaces, especially when working with collections and streams. Problem Statement Given an Arraylist the goal is to reverse the strings present in it. Below is a demonstration of the same − Input ("Apple", "Orange", "Grapes") Output elppA, egnarO, separG Reversing Strings in ...

Read More

What is the !! (not not) operator in JavaScript?

Alshifa Hasnain
Alshifa Hasnain
Updated on 20-Feb-2025 690 Views

In this article, we will learn about the !! (not not) operator in JavaScript.This double negation forces a value to be evaluated as either true or false. What is the !! Operator? The double negation(!! ) operator is the! Operator twice and calculates the truth value of a value. It returns a Boolean value, which depends on the truthiness of the expression.  How It Works: The first ! negates the value, converting it to true or false. The second ! negates it again, effectively converting it into a strict boolean (true or ...

Read More

JavaScript closures vs. anonymous functions

Alshifa Hasnain
Alshifa Hasnain
Updated on 20-Feb-2025 864 Views

In this article, we will learn about JavaScript's closures and anonymous functions. JavaScript is a powerful language that allows developers to write expressive and concise code. Two concepts that often confuse beginners are closures and anonymous functions. While they share some similarities, they serve different purposes and function differently in JavaScript What is Anonymous Functions? An anonymous function is simply a function without a name. Anonymous, as the name suggests, allows the creation of a function without any name identifier. It can be used as an argument to other functions, assigned to a variable, or immediately invoked. They are called using ...

Read More
Showing 151–160 of 221 articles
« Prev 1 14 15 16 17 18 23 Next »
Advertisements