Ramu Prasad has Published 74 Articles

How to create a context menu for an element in HTML5?

Ramu Prasad

Ramu Prasad

Updated on 03-Mar-2020 05:36:48

359 Views

Use the contextmenu attribute in HTML5 to create a context menu for an element. A context menu generates when a user right-clicks. ExampleYou can try to run the following code to create a context menu −           HTML menuitem Tag                        Right click inside here....                                                                              

Converting to upper case in Java.

Ramu Prasad

Ramu Prasad

Updated on 26-Feb-2020 09:41:12

166 Views

This method has two variants. The first variant converts all of the characters in this String to upper case using the rules of the given Locale. This is equivalent to calling toUpperCase(Locale.getDefault()).The second variant takes a locale as an argument to be used while converting into upper case.ExampleLive Demoimport java.io.*; ... Read More

Java strictfp keyword

Ramu Prasad

Ramu Prasad

Updated on 25-Feb-2020 05:15:28

1K+ Views

strictfp is used to ensure that floating points operations give the same result on any platform. As floating points precision may vary from one platform to another. strictfp keyword ensures the consistency across the platforms.strictfp can be applied to class, method or on interfaces but cannot be applied to abstract ... Read More

What does the method lastIndexOf(obj o) do in java?

Ramu Prasad

Ramu Prasad

Updated on 20-Feb-2020 12:20:20

43 Views

The lastIndexOf(Object) method of the class java.util.ArrayList returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.Exampleimport java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList arrlist = new ... Read More

What does the method addAll(int, Coll C) do in java?

Ramu Prasad

Ramu Prasad

Updated on 20-Feb-2020 11:30:57

55 Views

The addAll(int index, Collection

What is the Eclipse keyboard shortcut for "public static void main(String[] args) " in Java?

Ramu Prasad

Ramu Prasad

Updated on 20-Feb-2020 05:29:13

6K+ Views

To get public static void main(String[] args) line in eclipse without typing the whole line type main and press Ctrl + space then, you will get the option for the main method select it.

How to convert JSON Array to normal Java Array?

Ramu Prasad

Ramu Prasad

Updated on 19-Feb-2020 12:24:47

2K+ Views

The get method of the JSONArray class returns the element at a particular index. Using this method, you can get the elements of the JSONArray object and populate the array with them.Exampleimport java.util.Arrays; import org.json.JSONArray; public class JsonToArray {    public static void main(String args[]) throws Exception {   ... Read More

How to declare Java array with array size dynamically?

Ramu Prasad

Ramu Prasad

Updated on 19-Feb-2020 12:09:26

2K+ Views

To declare array size dynamically read the required integer value from the user using Scanner class and create an array using the given value:Exampleimport java.util.Arrays; import java.util.Scanner; public class PopulatingAnArray {    public static void main(String args[]) {       System.out.println("Enter the required size of the array :: ... Read More

How to convert an array of objects to an array of their primitive types in java?

Ramu Prasad

Ramu Prasad

Updated on 19-Feb-2020 11:04:46

154 Views

Apache Commons provides a library named org.apache.commons.lang3 and, following is the maven dependency to add the library to your project.           org.apache.commons       commons-lang3       3.0     This package provides a class named ArrayUtils. Using the toPrimitive() method of this class ... Read More

How MySQL stored function evaluates if it got NULL value while using the dynamic values from a table?

Ramu Prasad

Ramu Prasad

Updated on 13-Feb-2020 07:13:43

145 Views

In such kind of cases when a stored function got NULL values then it will return NULL as the result. It can be understood from the example below in which we have a NULL value in the records of student ‘Mohit’. Now, when we will apply the stored function ‘avg_marks’ ... Read More

Advertisements