Trending questions in Java

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
11,507 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
19,343 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
2,179 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 19,020 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
6,800 views
0 votes
2 answers

Splitting a string between letters and digits

Using Python READ MORE

Sep 17, 2020 in Java by Himanshu
4,653 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,761 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,844 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,384 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
6,720 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
22,368 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,883 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
13,907 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,840 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,696 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
5,020 views
0 votes
2 answers

How do I get the size of a java.sql.ResultSet?

You could probably do rows-count. ResultSet rs = ...READ MORE

Aug 22, 2019 in Java by Sirajul
• 59,190 points
13,954 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,300 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
4,173 views
0 votes
1 answer

Java and MySql: Delete database if exists

First, you have to check if the ...READ MORE

Sep 30, 2019 in Java by Kiran
2,732 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
968 views
0 votes
1 answer

Retrieving query from java.sql.PreparedStatement

By using prepared statements, you can't retrieve the query ...READ MORE

Oct 12, 2018 in Java by code.reaper12
• 3,500 points
17,690 views
+1 vote
1 answer

Adding Jar file to project

Changing the JRE System Library might work.  Right-click ...READ MORE

Sep 4, 2019 in Java by Esha
3,436 views
0 votes
2 answers

Please explain me the difference between scanner and the buffer reader?

As per your question for reading a ...READ MORE

Aug 27, 2019 in Java by Sirajul
• 59,190 points
4,125 views
0 votes
0 answers

How to run python script in java [closed]

Aug 22, 2019 in Java by anonymous

closed Aug 22, 2019 by Omkar 3,833 views
0 votes
2 answers

Include all the jars in a directory within the Java classpath

Just use lib/*   not lib/*.jar   That's the ...READ MORE

Apr 6, 2019 in Java by anonymous
16,387 views
+1 vote
0 answers

output occurs but invisible immediately how to rectify this ?

public class evenodd { public static void main(String[] ...READ MORE

Oct 17, 2019 in Java by BIPLAB
• 130 points
1,108 views
0 votes
1 answer

How to connect Java to MySql Database?

Make sure you have the MySQL jdbc ...READ MORE

Sep 30, 2019 in Java by Shyam
1,831 views
+1 vote
2 answers

Factorial of a number using while loop

import java.util.*; public class Fact { ...READ MORE

Mar 19, 2020 in Java by leela
• 140 points
4,501 views
0 votes
1 answer

"No mapping found for HTTP request with URI[....] in DispatherServlet"

Your standard Spring MVC application will serve ...READ MORE

Jun 6, 2018 in Java by prasad
• 160 points
22,351 views
0 votes
1 answer

What is Eclipse Clean Mode ?

What it does: if set to "true", any ...READ MORE

Jan 11, 2019 in Java by developer_1
• 3,350 points
12,621 views
0 votes
1 answer

Abstract class provides partial abstraction. How?

An Abstract class in java may have ...READ MORE

Jun 25, 2019 in Java by Sirajul
• 59,190 points
5,421 views
0 votes
1 answer

Integrate UTF-8 encoding in Java WebApp

Mostly characters äåö are not a problematic ...READ MORE

Dec 12, 2018 in Java by Sushmita
• 6,920 points
13,434 views
+1 vote
1 answer

How can I solve this example in an easy way??

You can use this code: import java.util.*; public class ...READ MORE

Sep 23, 2019 in Java by Omkar
• 69,180 points
1,132 views
0 votes
2 answers

How do I get distinct element from list in java?

You should use a Set. it doesn't contain duplicates. If ...READ MORE

Aug 23, 2019 in Java by Sirajul
• 59,190 points
2,502 views
0 votes
1 answer

Accessing Json array with Java

An org.json.JSONArray is not iterable. Here's how I process elements ...READ MORE

Jan 22, 2019 in Java by developer_1
• 3,350 points
11,300 views
0 votes
1 answer

How to add items in list at a time?

Hi Priyanka , I think this code snippet ...READ MORE

Aug 9, 2019 in Java by sampriti
• 1,120 points
2,685 views
0 votes
1 answer

how to compare two words in java?

hey,  I think in your code the function ...READ MORE

Aug 8, 2019 in Java by sampriti
• 1,120 points

edited Aug 8, 2019 by Kalgi 2,635 views
0 votes
1 answer

How to get text from text box in Swing?

You can add a Button listener here. ...READ MORE

Aug 27, 2019 in Java by Jishan
1,617 views
0 votes
1 answer

Handling empty input in swing text box

login_but.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ //System.out.print(F_user.getText()); String username ...READ MORE

Aug 27, 2019 in Java by Nila
1,604 views
0 votes
0 answers

why the should be final

Sep 17, 2019 in Java by anonymous
658 views
0 votes
1 answer

Swing Java create Text Box

In the frame, you can use the ...READ MORE

Aug 27, 2019 in Java by Kyle
1,502 views
0 votes
1 answer

Do I have download any jars related to ZeonPad or do i perfrom the above code directly in Eclipse IDE. Please guide me.

Hello @Basha.  If you are running it on ...READ MORE

Aug 21, 2019 in Java by Ramya
1,665 views
0 votes
1 answer

How to connect Java to MySql Database?

This will work: try { ...READ MORE

Aug 27, 2019 in Java by John
1,401 views
0 votes
1 answer

Create Buttons in Java Swing

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

Aug 27, 2019 in Java by Esha
1,392 views
0 votes
1 answer

How to create text labels in Swing, Java?

In the frame, you can use the ...READ MORE

Aug 27, 2019 in Java by Jimmy
1,390 views
0 votes
1 answer

How to set margins in a LinearLayout programmatically?

LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams layoutParams = ...READ MORE

Dec 20, 2018 in Java by Daisy
• 8,140 points
12,201 views
0 votes
2 answers

How to return multiple objects from a Java method?

In the event the method you're calling ...READ MORE

Aug 30, 2019 in Java by Karan
• 19,550 points
9,906 views
0 votes
2 answers

Java Security: Illegal key size or default parameters

Starting from Java 9 or 8u151, you ...READ MORE

Aug 23, 2018 in Java by Parth
• 4,640 points
9,095 views