Trending questions in Java

0 votes
1 answer

Which is faster amongst an Array and an ArrayList?

Array Over List: The capacity of an Array is fixed.  Whereas ArrayList can ...READ MORE

Jul 20, 2018 in Java by sophia
• 1,400 points
27,578 views
0 votes
1 answer

How does Java convert integer value into byte?

When an integer value is converted into ...READ MORE

Feb 28, 2019 in Java by Avantika
• 1,520 points

edited Feb 28, 2019 by Omkar 17,927 views
0 votes
0 answers

If statement not working in AWS Lamnda - S3Event code

Hi, I am using below  lambda function with ...READ MORE

Apr 4, 2020 in Java by Abhishek
• 280 points
623 views
0 votes
1 answer

How to refresh a JTable model after insert delete or update the data

In my opinion, you can notify your ...READ MORE

Oct 11, 2018 in Java by code.reaper12
• 3,500 points
23,883 views
0 votes
0 answers

Where exactly in the variable file path will I paste the javac file path?

I wrongly placed the javac file in ...READ MORE

Apr 2, 2020 in Java by anonymous
• 120 points
550 views
0 votes
1 answer

how to do global variable declaration in java

Hello,​ Global varriable which is defined after the ...READ MORE

Apr 3, 2020 in Java by Niroj
• 82,880 points
464 views
+1 vote
1 answer

How to generate a class at runtime in Java?

Yes: you can do it with Burningwave ...READ MORE

Mar 16, 2020 in Java by Roberto
• 460 points

edited Apr 14, 2020 by Roberto 987 views
0 votes
1 answer

Escaping strings in JSON

You can find a JSON library in your ...READ MORE

Oct 4, 2018 in Java by geek.erkami
• 2,680 points
23,797 views
0 votes
1 answer

What is Modeshape. How can i use this?

ModeShape is an open-source implementation of the JSR-283 specification and ...READ MORE

Mar 30, 2020 in Java by Gitika
• 65,910 points
816 views
0 votes
1 answer

Types of IOC containers in Spring Framework

There are basically two types of IOC ...READ MORE

Aug 28, 2018 in Java by misc.edu04
• 1,450 points
25,198 views
+2 votes
2 answers

How to connect to Oracle using Service Name instead of SID?

HII.. I hope this information may help you- Thin-style ...READ MORE

Sep 29, 2020 in Java by SRI
9,607 views
0 votes
0 answers

How to handle simultaneous requests using springboot?

A gateway and load balancer built using ...READ MORE

Feb 9, 2020 in Java by anonymous
• 19,610 points
1,464 views
0 votes
2 answers

how can we Create instance for generic type in java

private static class SomeContainer<E> { ...READ MORE

Aug 27, 2018 in Java by Sushmita
• 6,910 points
25,977 views
0 votes
1 answer

How can you catch an exception thrown by another thread in Java?

This can be done using Thread.UncaughtExceptionHandler. Here’s a simple ...READ MORE

Dec 3, 2018 in Java by Frankie
• 9,830 points
19,955 views
0 votes
1 answer

How to solve this error: No Persistence provider for EntityManager named

After <persistence-unit name="agisdb">, define the persi ...READ MORE

Jan 8, 2019 in Java by Daisy
• 8,120 points
18,404 views
0 votes
2 answers

How to convert List<Integer> to int[] in Java?

In addition to Commons Lang, you can ...READ MORE

Aug 20, 2019 in Java by Sirajul
• 59,230 points
14,872 views
0 votes
3 answers

How autowiring works in Spring?

First, and most important - all Spring ...READ MORE

Jan 11, 2019 in Java by developer_1
• 3,320 points
17,963 views
+1 vote
0 answers

I am getting below error "The method readerFor(Class<Map>) is undefined for the type CsvMapper"

I Have requirement to convert csv to ...READ MORE

Dec 29, 2019 in Java by anonymous
• 160 points
2,754 views
0 votes
1 answer

How can I get the current date and time in UTC or GMT in Java?

This definitely returns UTC time: as String ...READ MORE

Jun 7, 2018 in Java by Rishabh
• 3,620 points
27,079 views
0 votes
1 answer

Why is my Spring @Autowired field null?

If you are not coding a web ...READ MORE

Dec 27, 2018 in Java by Daisy
• 8,120 points

edited Mar 4, 2022 by Sarfaraz 18,153 views
+2 votes
1 answer

please someone tell the code to launch an instance in digital ocean using java

In order to create a digital ocean ...READ MORE

Jan 14, 2020 in Java by Sirajul
• 59,230 points
1,060 views
+1 vote
0 answers

getting below error when trying to conver csv file to json :The method readerFor(Class<Map>) is undefined for the type CsvMapper [closed]

PFB source code: import java.io.File; import java.lang.*; import java.util.Arrays; import java.util.List; import ...READ MORE

Dec 29, 2019 in Java by anonymous
• 160 points

closed Jan 14, 2020 by Kalgi 1,761 views
0 votes
1 answer

Java execute vs executeQuery vs executeUpdate

I think the major differences between execute, executeQuery, ...READ MORE

Jul 31, 2018 in Java by geek.erkami
• 2,680 points
23,955 views
0 votes
1 answer

Importing classes in JSP

Use Page Directive to import a Class ...READ MORE

May 25, 2018 in Java by Rishabh
• 3,620 points
26,780 views
+1 vote
1 answer

Program for nth prime number without using scanner

Hi @Sneha, you could use something like ...READ MORE

Jan 13, 2020 in Java by Kalgi
• 52,360 points
868 views
0 votes
1 answer

Is there a way to mask the password from java user input that comes from Scanner class and System.out.Println()?

You can use the console class to do so. ...READ MORE

May 27, 2019 in Java by Omkar
• 69,210 points
10,724 views
+1 vote
1 answer

Is Java a compiled language or interpreted?

Compiled languages are directly converted into machine ...READ MORE

Dec 18, 2019 in Java by Hannah
• 18,570 points
1,731 views
0 votes
2 answers

How to ignore exception in Java?

There is no way to basically ignore a ...READ MORE

Aug 16, 2019 in Java by Sirajul
• 59,230 points
11,923 views
+1 vote
2 answers

Calculating date/time difference in Java

We can also use java.util.concurrent.TimeUnit class. long diff = d2.getTime() ...READ MORE

Aug 28, 2018 in Java by Sushmita
• 6,910 points
23,453 views
+2 votes
3 answers

Listing all the subclasses of a specific class in Java

Try with BurningWave core library. Here an ...READ MORE

Dec 29, 2019 in Java by anonymous
• 460 points

edited Jan 9, 2020 by anonymous 13,032 views
0 votes
2 answers

In Java, what is the best way to determine the size of an object?

I happened to find a java class "jdk.nashorn.internal.ir.debug.ObjectSizeCalculator", ...READ MORE

Aug 19, 2019 in Java by Sirajul
• 59,230 points
12,248 views
0 votes
2 answers

Splitting a string between letters and digits

Using Python: https://stackoverflow.com/a/63936955/8117673 READ MORE

Sep 17, 2020 in Java by Himanshu
4,128 views
+1 vote
1 answer

how to print this statement in java print(' '*(r-x-1)+'*'*(2*x+1)) ( logic used in python .its perfect) but java wrong output came

In ' '*(r-x-1) and '*'*(2*x+1), you used multiplication ...READ MORE

Dec 22, 2019 in Java by Utsab Bandyopadhyay
906 views
0 votes
2 answers

What are the different types of constructor in StringBuilder class?

StringBuilder  we 4  as mentioned below. READ MORE

Sep 1, 2020 in Java by Sri
• 3,190 points
1,064 views
0 votes
1 answer

Concern and cross-cutting concern in Spring AOP

The concern is the behavior we want ...READ MORE

Nov 16, 2018 in Java by code.reaper12
• 3,500 points

edited Mar 4, 2022 by Sarfaraz 17,591 views
0 votes
2 answers

Unable to execute jar- file: “no main manifest attribute”

Check out the answer here https://stackoverflow.com/a/61372736/7747942 READ MORE

Apr 23, 2020 in Java by Anonymous
2,765 views
0 votes
2 answers

Scanner is skipping nextLine() after using next() or nextFoo()?

use input.nextLine(); after your nextInt() function for example:- input.nextInt(); ...READ MORE

May 11, 2019 in Java by Sourav Dangi
17,014 views
+29 votes
3 answers

How can we set java.library.path in Eclipse?

Go into the library settings for your ...READ MORE

Jul 3, 2018 in Java by sharth
• 3,370 points
20,976 views
0 votes
1 answer

How to Convert .msg (outlook mail) to pdf using java

Hi @Basha! Here's a code to help you ...READ MORE

Aug 21, 2019 in Java by Kishan
4,960 views
0 votes
0 answers

java regex split string into double numbers and-letters

I am having a problem splitting something ...READ MORE

Nov 14, 2019 in Java by khs
• 120 points
1,262 views
+1 vote
1 answer

Setting selected item of Spinner by value rather than by position

Suppose your Spinner is named newSpinner, and it contains ...READ MORE

Aug 10, 2018 in Java by 93.lynn
• 1,600 points
21,054 views
+1 vote
1 answer

How to create database in MySql using Java?

First, you will have to create connection ...READ MORE

Sep 30, 2019 in Java by Shri
3,031 views
+1 vote
2 answers

Non-static variable cannot be referenced from a static context. Explain?

class Program { int count ...READ MORE

Sep 28, 2019 in Java by anonymous
13,636 views
+2 votes
0 answers

How to add external Jar in modular JavaFX 11 project correctly?

I'm using Java 11 and JavaFX 11. ...READ MORE

Aug 8, 2019 in Java by invzbl3
5,140 views
0 votes
1 answer

Java and MySql: Check if database exists

You can get the list of databases ...READ MORE

Sep 30, 2019 in Java by Tina
2,690 views
0 votes
1 answer

Java and MySql: Check if database exists

You can get the list of databases ...READ MORE

Aug 27, 2019 in Java by Kunal
3,918 views
0 votes
1 answer

What is the difference between main(String[] args) and main(String... args) in Java?

String[] is used to accept a single parameter ...READ MORE

Sep 6, 2019 in Java by Piya
3,435 views
0 votes
0 answers

pass datasource for job to AWS Glue client in JAVA

How can i mention datasource for AWS ...READ MORE

Nov 10, 2019 in Java by cheshta
• 120 points
647 views