Trending questions in Java

–1 vote
0 answers

Write a program that uses a while loop to read 10 integer numbers from file

Write a program that uses a while ...READ MORE

Apr 16, 2020 in Java by MIH
• 150 points
2,864 views
0 votes
0 answers

I cannot build and sync my gradle in androidstudio.

how to build and sync my gradle ...READ MORE

May 8, 2020 in Java by Edureka
• 120 points
1,791 views
0 votes
1 answer

How to call setUndecorated() after a frame is made visible?

Hello kartik, You can Try: dispose(); setUndecorated(true); setVisible(true); Check it Out. Hope ...READ MORE

Apr 21, 2020 in Java by Niroj
• 82,800 points
2,395 views
0 votes
2 answers

What is immutable string in java?

To answer your question, the String is ...READ MORE

Feb 9, 2022 in Java by Soham
• 9,730 points
1,968 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
28,297 views
0 votes
2 answers

can i run two tomcat servers on the same linux VM machine?

Hello @Ganesh, To run and configure multiple instances ...READ MORE

Jul 30, 2020 in Java by Niroj
• 82,800 points
7,077 views
0 votes
1 answer

How to implement draggable tab using Java Swing?

Hello kartik, setAcceptor(TabAcceptor a_acceptor) should let the consumer code ...READ MORE

Apr 21, 2020 in Java by Niroj
• 82,800 points
2,145 views
0 votes
1 answer

How to open warning/information/error dialog in swing?

Hello, You can try out : import javax.swing.JFrame; import javax.swing.JOptionPane; public ...READ MORE

Apr 21, 2020 in Java by Niroj
• 82,800 points
2,136 views
0 votes
1 answer

What Kind of Files IOC Container can Read other than XML directly or Indirectly?

Hi, @Ferry, The configuration metadata is nothing but bean ...READ MORE

Apr 23, 2020 in Java by Gitika
• 65,730 points
2,030 views
0 votes
1 answer

What is the reason for no ConcurrentHashSet against ConcurrentHashMap?

Hello, There's no built in type for ConcurrentHashSet because you ...READ MORE

Apr 8, 2020 in Java by Niroj
• 82,800 points
2,620 views
0 votes
1 answer

How to set JFrame to appear centered, regardless of monitor resolution?

Hello kartik, You can  always did it in ...READ MORE

May 7, 2020 in Java by Niroj
• 82,800 points
1,310 views
0 votes
1 answer

How to add tabs to JTabbedPane using WindowBuilder?

Hii, You can just find out by given ...READ MORE

Apr 21, 2020 in Java by Niroj
• 82,800 points
1,965 views
0 votes
2 answers

How do i create generic array in Java

as first tip you cannot assign value ...READ MORE

Feb 13, 2020 in Java by sama
18,528 views
0 votes
1 answer

How can we activate JMX on my JVM for access with jconsole?

Hello @kartik, Run your java application with the ...READ MORE

Apr 9, 2020 in Java by Niroj
• 82,800 points
2,045 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,190 points
18,373 views
0 votes
1 answer

Error:“java.lang.OutOfMemoryError: Java heap space” ?

Hii, Possible causes: Simple configuration issue, where the specified ...READ MORE

Apr 8, 2020 in Java by Niroj
• 82,800 points
1,969 views
0 votes
1 answer

How to run a Java program from the command line on Windows?

Hello @kartik, In case your Java class is ...READ MORE

Apr 9, 2020 in Java by Niroj
• 82,800 points
1,910 views
0 votes
0 answers

How to manage two JRadioButtons in java so that only one of them can be selected at a time?

How to manage two JRadioButtons in java ...READ MORE

Apr 21, 2020 in Java by kartik
• 37,520 points
1,376 views
0 votes
1 answer

How could I implement autocompletion using Swing?

Hello, You can try out this: import java.awt.*; import java.awt.event.*; import ...READ MORE

Apr 21, 2020 in Java by Niroj
• 82,800 points
1,209 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 19,249 views
0 votes
1 answer

java path not found in window 7

Hey, You can follow these few steps: From the ...READ MORE

Apr 3, 2020 in Java by Gitika
• 65,730 points
1,965 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
28,583 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,800 points
1,571 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
25,371 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,800 points
1,480 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
1,606 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
989 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,800 points
1,460 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
11,420 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
1,507 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
28,182 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,942 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
20,458 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,730 points
1,639 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
20,031 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 17,049 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,600 points
29,968 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
4,523 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,550 points
2,395 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 20,004 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,600 points
28,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
26,440 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,190 points
14,256 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
20,680 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,190 points
14,701 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,340 points
2,228 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,180 points
12,102 views