Most viewed questions in Java

0 votes
0 answers

How are arrays implemented in java?

In Java, arrays are implemented as objects, ...READ MORE

Aug 18, 2022 in Java by krishna
• 2,820 points
355 views
0 votes
0 answers

What is lexical scope?

What is a quick overview of lexical ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
352 views
0 votes
1 answer

How do I join two lists in Java?

In Java 8: List<String> newList = Stream.concat(listOne.stream(), listTwo.stream()) ...READ MORE

Dec 30, 2020 in Java by Gitika
• 65,910 points
350 views
0 votes
0 answers

Javascript call() & apply() vs bind()?

I'm already aware that apply and calls are functions that do the same thing (context of a function). The distinction is in how we communicate the arguments (manual vs array). When should I, however, utilize the bind() method? var obj = { x: ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
349 views
0 votes
1 answer

Number of Characters in Java String

I think you can make use of ...READ MORE

Oct 23, 2018 in Java by anto.trigg4
• 3,440 points
347 views
0 votes
0 answers

How can I remove a specific item from an array?

How do I get rid of a specific value from an array?  As an example: array.remove(value); // removes all elements with ...READ MORE

Sep 21, 2022 in Java by Nicholas
• 7,760 points
344 views
0 votes
1 answer

Recursively delete directories in Java

You can try using the FileUtils class of Apache's commons-io: FileUtils.deleteDirectory(new ...READ MORE

Oct 23, 2018 in Java by code.reaper12
• 3,500 points
340 views
0 votes
1 answer

How to merge two arrays in JavaScript and de-duplicate items?

With Underscore.js or Lo-Dash you can use: console.log(_.union([1, ...READ MORE

Feb 18, 2022 in Java by Aditya
• 7,680 points
337 views
0 votes
1 answer

How do I redirect with JavaScript?

To redirect to another page by Using ...READ MORE

Feb 16, 2022 in Java by Aditya
• 7,680 points
336 views
0 votes
1 answer

Why main method is static in Java?

In Java, the `main` method is required ...READ MORE

Oct 19, 2023 in Java by anonymous
• 3,320 points

edited Oct 19, 2023 by anonymous 335 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
335 views
0 votes
1 answer

HTML Parsing in Java

Well, to parse HTML I used JTidy.  Basically, ...READ MORE

Nov 2, 2018 in Java by geek.erkami
• 2,680 points
335 views
0 votes
0 answers

What does "javascript:void(0)" mean?

<a href="javascript:void(0)" id="loginlink">login</a> ...READ MORE

Sep 20, 2022 in Java by Nicholas
• 7,760 points
334 views
0 votes
0 answers

window.location.href and window.open () methods in JavaScript

What is the difference between window.location.href and ...READ MORE

Sep 20, 2022 in Java by Nicholas
• 7,760 points
333 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
331 views
0 votes
1 answer

Why multiple inheritance is not supported in Java?

The absence of multiple inheritance in the ...READ MORE

Oct 17, 2023 in Java by anonymous
• 3,320 points
330 views
0 votes
0 answers

For-each over an array in JavaScript

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

Sep 21, 2022 in Java by Nicholas
• 7,760 points
329 views
0 votes
1 answer

How to run applet program in java?

Running an applet program in Java has ...READ MORE

Nov 9, 2023 in Java by anonymous
• 3,320 points
328 views
0 votes
0 answers

Javascript require() function giving ReferenceError: require is not defined

Essentially, I'm using javascript to scrape data from the Google Play store by: 1-Request 2-Cheerios 3-QueryString I used Google Market API from Github ...READ MORE

Sep 21, 2022 in Java by Nicholas
• 7,760 points
328 views
0 votes
0 answers

Returning arrays in Java

I am trying to return an array ...READ MORE

Aug 11, 2022 in Java by krishna
• 2,820 points
322 views
0 votes
0 answers

What is "String args[]"? parameter in main method Java

I am a beginner in java and ...READ MORE

May 15, 2022 in Java by Kichu
• 19,050 points
322 views
0 votes
0 answers

For-each over an array in JavaScript

How can I loop through all the ...READ MORE

Apr 19, 2022 in Java by Rahul
• 3,380 points
321 views
0 votes
1 answer

jquery $.each() for objects

The $.each() works for objects and arrays ...READ MORE

Feb 16, 2022 in Java by Aditya
• 7,680 points
320 views
0 votes
1 answer

What does Animal a = (Animal) data[0]; do?

Hello @zaraaq , You can refer this for your ...READ MORE

Dec 2, 2020 in Java by Niroj
• 82,880 points
320 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
318 views
0 votes
0 answers

What does [object Object] mean? (JavaScript)

One of my notifications had the follo ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
318 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
314 views
0 votes
1 answer

How to break a number to individual digit?

The best way would be find the ...READ MORE

Mar 7, 2019 in Java by Priyaj
• 58,090 points
314 views
0 votes
0 answers

How to convert a string to an integer in JavaScript?

In JavaScript, how do I convert a ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
312 views
0 votes
0 answers

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

There doesn't seem to be a String.contains() ...READ MORE

Sep 21, 2022 in Java by Nicholas
• 7,760 points
312 views
0 votes
0 answers

Why does Java's Arrays.sort method use two different sorting algorithms for different types?

The array.sort method in Java 6 makes ...READ MORE

Aug 3, 2022 in Java by krishna
• 2,820 points
309 views
0 votes
1 answer

what is super keyword in java

In Java, the super keyword is used ...READ MORE

Oct 17, 2023 in Java by Rishabh
308 views
0 votes
1 answer

Where can an object store its states Java?

In Java, an object stores its internal ...READ MORE

Oct 23, 2023 in Java by anonymous
• 3,320 points
303 views
0 votes
0 answers

Convert javascript array to string

I'm attempting to loop through a "value" ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
302 views
0 votes
0 answers

Generating PDF files with JavaScript

I was hoped that I could accomplish ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
300 views
0 votes
1 answer

what is j2ee in java

J2EE (Java 2 Platform, Enterprise Edition) is ...READ MORE

Nov 10, 2023 in Java by John
298 views
0 votes
1 answer

What is dynamic method dispatch in Java?

Dynamic Method Dispatch is a fundamental concept ...READ MORE

Nov 29, 2023 in Java by anonymous
• 3,320 points
297 views
0 votes
1 answer

Check if a variable is a string in JavaScript

This is what I've found to be ...READ MORE

Nov 15, 2022 in Java by Damonlang
• 1,230 points
296 views
0 votes
1 answer

How to take character input in Java?

In Java, you can take character input ...READ MORE

Oct 19, 2023 in Java by anonymous
• 3,320 points

edited Oct 19, 2023 by anonymous 295 views
0 votes
1 answer

Why is subtracting these two times (in 1927) giving a strange result?

In TZDB 2014f, the time of the ...READ MORE

Dec 21, 2020 in Java by Gitika
• 65,910 points
292 views
0 votes
1 answer

How Hashmap works internally in java?

A popular data structure for storing key-value ...READ MORE

Oct 11, 2023 in Java by anonymous
• 3,320 points
291 views
0 votes
0 answers

How to create an array containing 1...N

I'm looking for alternatives to the following for creating a JavaScript array with values ranging from 1 to N, where N is only known at  runtime. var foo = []; for (var i = ...READ MORE

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

How do I format a date in JavaScript?

How can I convert a Date object ...READ MORE

Sep 21, 2022 in Java by Nicholas
• 7,760 points
289 views
0 votes
1 answer

Testing question and answer

Testing question and answer. READ MORE

Nov 16, 2021 in Java by anonymous
• 300 points
286 views
0 votes
1 answer

What is location.search in javascript

http://example.com/index.php?foo=bar location.search > ?foo=bar ...READ MORE

Nov 8, 2022 in Java by Damonlang
• 700 points
285 views
0 votes
1 answer

Which equals operator (== vs ===) should be used in JavaScript comparisons?

I hope this is what you're looking for: const today = new Date(); const yyyy = ...READ MORE

Nov 4, 2022 in Java by Damonlang
• 700 points
284 views
0 votes
0 answers

javascript Image tag

I'm adding an image snapshot of a ...READ MORE

Nov 8, 2022 in Java by Nicholas
• 7,760 points
282 views
0 votes
0 answers

Convert integer to string

Given a number: int number = 1234; Which would ...READ MORE

Apr 26, 2022 in Java by Rahul
• 3,380 points
282 views
0 votes
0 answers

How do I declare and initialize an array in Java?

How do I declare and initialize an ...READ MORE

Feb 8, 2022 in Java by Edureka
• 120 points
282 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
280 views