Most answered questions in Java

0 votes
1 answer

How to print java array in the simplest way?

String[] arr = new String[] {"John", "Mary", ...READ MORE

Apr 17, 2018 in Java by sophia
• 1,400 points
660 views
0 votes
1 answer

How to take input from users?

Scanner Class is used to take input ...READ MORE

Apr 17, 2018 in Java by Akrati
• 3,190 points
581 views
0 votes
1 answer

How do I fix a NullPointerException?

When you declare a reference variable (i.e. ...READ MORE

Apr 13, 2018 in Java by Parth
• 4,630 points
706 views
0 votes
1 answer

How to divide a string in two parts

String s="yourstring"; boolean flag = true; for(int i=0;i<s.length();i++) { ...READ MORE

Apr 13, 2018 in Java by Rishabh
• 3,620 points
949 views
0 votes
0 answers

what is class component in react ?

Jan 12 in Java by Evanjalin
• 360 points
120 views
0 votes
0 answers

How to iterate arraylist in java?

How does one perform iteration over an ...READ MORE

Dec 19, 2023 in Java by Saniya
• 3,320 points
189 views
0 votes
0 answers

How to capitalize first letter in java?

How can one implement the capitalization of ...READ MORE

Dec 19, 2023 in Java by Saniya
• 3,320 points
179 views
0 votes
0 answers

how to compile java code in command prompt

how to compile java code in command ...READ MORE

Nov 29, 2023 in Java by Priyanka
• 700 points
151 views
0 votes
0 answers

why so JavaScript and java have similar name

Nov 29, 2023 in Java by Priyanka
• 700 points
192 views
0 votes
0 answers

how to sort 2d array in java ?

Nov 29, 2023 in Java by Evanjalin
• 360 points
266 views
0 votes
0 answers

How to set the java_home path in Windows 10?

How to set the java_home path in ...READ MORE

Nov 3, 2023 in Java by Arya
• 990 points
189 views
0 votes
0 answers

String to char array

How to convert a string to a ...READ MORE

Nov 3, 2023 in Java by Arya
• 990 points
189 views
0 votes
0 answers

Java Programming

why java is platform independent READ MORE

Sep 28, 2023 in Java by Arya
• 990 points
138 views
0 votes
0 answers

How to check whether a string contains a substring in JavaScript?

Usually I would expect a String.contains() method, but there ...READ MORE

Sep 13, 2023 in Java by Rahul
• 240 points
202 views
0 votes
0 answers

When to use promise.all()?

What is/are the appropriate scenario(s) for using promise.all() OR Is there a better way to utilize promise.all()?  Should it be used ideally just when all of the promise objects are of the same or comparable type? The only one that comes to mind is: Use promise.all() if you want to resolve the promise only if all of ...READ MORE

Dec 12, 2022 in Java by Nicholas
• 7,760 points
319 views
0 votes
0 answers

How can I find the prime factors of an integer in JavaScript?

Using a for loop in javascript, I was attempting to determine the prime factors of a number, denoted as 'integer' below.  I can't seem to get it to work, and I'm not sure if it's because of my JavaScript or my calculating logic. //integer is the value for which we ...READ MORE

Dec 12, 2022 in Java by Nicholas
• 7,760 points
814 views
0 votes
0 answers

Generate pdf from HTML in div using Javascript

I have the following HTML code: <!DOCTYPE html> <html> ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
836 views
0 votes
0 answers

Loop over an array in JavaScript

How can I use JavaScript to loop ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
465 views
0 votes
0 answers

How do I get the current time only in JavaScript

In JavaScript, how can I retrieve the ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
421 views
0 votes
0 answers

Which is better: <script type="text/javascript">...</script> or <script>...</script>

Which is more effective or convenient  ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
269 views
0 votes
0 answers

JavaScript: undefined !== undefined?

When I first tried to access Facebook API operations after integrating Facebook Connect with Tersus, I received the error messages Invalid Enumeration Value and Handler already exists. It was discovered that the source of the problem was object.x === undefined When there is no property 'x' in 'object,' returns false. I solved the problem by substituting normal equality for rigorous equality in two Facebook functions: FB.Sys.isUndefined = function(o) { return ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
337 views
0 votes
0 answers

Const in JavaScript: when to use it and is it necessary?

In JavaScript, I recently came across the ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
227 views
0 votes
0 answers

How to add days to Date?

How can I add days to the ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
231 views
0 votes
0 answers

How to stop timer in javascript?

I'd want to end a timer by clicking a button, but I can't figure out how.  I tried using clearInterval() to halt a timer, but I'm not sure whether it was called correctly. This is my current code. <html> <head> <title>Bootstrap</title> ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
695 views
0 votes
0 answers

Convert a number into a Roman numeral in JavaScript

What is the best way to convert integers to roman numerals? function romanNumeralGenerator (int) { } Consider the following sample inputs and outputs: 1 = "I" 5 = ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
688 views
0 votes
0 answers

How do I remove an object from an array with JavaScript?

I have a JavaScript object that looks ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
235 views
0 votes
0 answers

How to get the current London time and date using javascript

Using the code below, I attempted to& ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
750 views
0 votes
0 answers

How is a JavaScript hash map implemented?

I'm using OpenLayers right now and need ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
245 views
0 votes
0 answers

Check if a value is an object in JavaScript

How do you check if a value ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
234 views
0 votes
0 answers

How does the "this" keyword work, and when should it be used?

I'm trying to figure out what the&nbs ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
394 views
0 votes
0 answers

What is the meaning of polyfills in HTML5?

Actually, I have no idea what polyfills ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
217 views
0 votes
0 answers

Best place to insert JavaScript within a HTML document

Where should the javascript code go? ...READ MORE

Dec 6, 2022 in Java by Nicholas
• 7,760 points
284 views
0 votes
0 answers

How do I link a JavaScript file to a HTML file?

How should a JavaScript file be linked ...READ MORE

Dec 6, 2022 in Java by Nicholas
• 7,760 points
235 views
0 votes
0 answers

Javascript remove background color and opacity

How can I delete the background-color  ...READ MORE

Dec 6, 2022 in Java by Nicholas
• 7,760 points
1,995 views
0 votes
0 answers

What is 'Currying'?

I've seen references to curried functions in ...READ MORE

Dec 6, 2022 in Java by Nicholas
• 7,760 points
205 views
0 votes
0 answers

How to check if an object is a Promise?

Whether it's an ES6 Promise, a Bluebird ...READ MORE

Dec 6, 2022 in Java by Nicholas
• 7,760 points
263 views
0 votes
0 answers

Javascript counting number of objects in object

I have an object something like: Object {0=Object, ...READ MORE

Nov 17, 2022 in Java by Nicholas
• 7,760 points
484 views
0 votes
0 answers

How to detect #enable-force-dark flag on Chrome v78+ using JavaScript?

I just developed and implemented a dark ...READ MORE

Nov 17, 2022 in Java by Nicholas
• 7,760 points
338 views
0 votes
0 answers

What is the use of the JavaScript 'bind' method?

What is the use of bind() in ...READ MORE

Nov 17, 2022 in Java by Nicholas
• 7,760 points
278 views
0 votes
0 answers

How to remove item from array by value?

Is it possible to delete an item ...READ MORE

Nov 17, 2022 in Java by Nicholas
• 7,760 points
233 views
0 votes
0 answers

Generating Fibonacci Sequence

var x = 0; var y = 1; var ...READ MORE

Nov 17, 2022 in Java by Nicholas
• 7,760 points
400 views
0 votes
0 answers

What is the meaning of "$" sign in JavaScript

A dollar ($) symbol appears in the ...READ MORE

Nov 16, 2022 in Java by Nicholas
• 7,760 points
215 views
0 votes
0 answers

Can you control GIF animation with Javascript?

Is it feasible to use Javascript to ...READ MORE

Nov 16, 2022 in Java by Nicholas
• 7,760 points
583 views
0 votes
0 answers

What is DOM Event delegation?

Can anyone please explain event delegation in ...READ MORE

Nov 16, 2022 in Java by Nicholas
• 7,760 points
245 views
0 votes
0 answers

What is TypeScript and why would I use it in place of JavaScript?

Could you kindly explain the TypeScript language? What ...READ MORE

Nov 16, 2022 in Java by Nicholas
• 7,760 points
260 views
0 votes
0 answers

Why doesn't importing java.util.* include Arrays and Lists?

I am using java on debian 5 java ...READ MORE

Nov 16, 2022 in Java by Ashwini
• 5,430 points
561 views
0 votes
0 answers

Arrays.fill with multidimensional array in Java

Without using a loop, how can I ...READ MORE

Nov 16, 2022 in Java by Ashwini
• 5,430 points
461 views
0 votes
0 answers

What is the difference between contiguous and non-contiguous arrays?

In the numpy manual about the reshape() function, it ...READ MORE

Nov 16, 2022 in Java by Ashwini
• 5,430 points
495 views
0 votes
0 answers

How do JavaScript closures work?

How would you explain JavaScript closures to ...READ MORE

Nov 15, 2022 in Java by Nicholas
• 7,760 points
364 views
0 votes
0 answers

Download File Using JavaScript/jQuery

I have a similar requirement listed here. When ...READ MORE

Nov 15, 2022 in Java by Nicholas
• 7,760 points
320 views