Trending questions in Java

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 18,398 views
0 votes
1 answer

Error: Unable to run mksdcard SDK tool in java?

Hello, If you use  Ubuntu, you can try: sudo apt-get ...READ MORE

Apr 9, 2020 in Java by Niroj
• 82,840 points
818 views
0 votes
0 answers

HOw can i do this?

The department of History has just bought ...READ MORE

Apr 16, 2020 in Java by MIH
• 150 points
527 views
0 votes
1 answer

How to pass an object from one activity to another on Android?

Hello @kartik, Implement your class with Serializable. Let's ...READ MORE

Apr 8, 2020 in Java by Niroj
• 82,840 points
770 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
856 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
24,418 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
832 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,840 points
722 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 1,212 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,770 points
1,051 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
10,098 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
16,049 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,920 points
26,817 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,140 points
19,215 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,350 points
18,631 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,721 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,920 points
25,723 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
3,188 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,613 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,140 points

edited Mar 4, 2022 by Sarfaraz 18,781 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
28,013 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
24,723 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 14,502 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
12,884 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,281 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 2,048 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,350 points
1,248 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,220 points
11,101 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
13,069 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,520 points
1,875 views
0 votes
2 answers

Splitting a string between letters and digits

Using Python READ MORE

Sep 17, 2020 in Java by Himanshu
4,344 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
22,341 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 18,350 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,966 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
1,141 views
0 votes
2 answers

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

Check out the answer here. READ MORE

Apr 23, 2020 in Java by Anonymous
3,209 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,363 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
5,736 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,672 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,910 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,539 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
14,143 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,295 views
0 votes
1 answer

Switch JPanels inside a JFrame

Instead of trying to add an remove ...READ MORE

Feb 14, 2019 in Java by developer_1
• 3,350 points
12,988 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
4,510 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
3,012 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,738 views