Trending questions in Java

0 votes
1 answer

How can we run eclipse in clean mode? and what will happen if we do so?

if set to "true", any cached data ...READ MORE

Jan 11 in Java by Daisy
• 8,050 points
50 views
0 votes
1 answer

Unable to Run the .java file

You have to enter the commands as ...READ MORE

Jan 10 in Java by Omkar
• 67,620 points
43 views
0 votes
2 answers

how to increase heap size in java?

Here is how you can increase the ...READ MORE

Aug 23 in Java by Sirajul
• 29,340 points
38 views
0 votes
0 answers

Can anyone explain Autowiring in Spring ?

Say I have a service class called UserServiceImpl that ...READ MORE

Jan 11 in Java by Sushmita
• 6,880 points
40 views
0 votes
1 answer

object references an unsaved transient instance - save the transient instance before flushing

You should add cascade="all" (if using xml) ...READ MORE

Sep 26, 2018 in Java by parth295
• 4,640 points
4,622 views
0 votes
1 answer

Exception Handling: “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it

Iterator<String> iter = myArrayList.iterator(); while (iter.hasNext()) { ...READ MORE

Jan 10 in Java by Sushmita
• 6,880 points
38 views
0 votes
1 answer

Can I help with the gradle code for AspectJ?

You can go to maven repositories https://mvnrepository.com/artifact/org.aspectj/aspectjtools/1.9.2 ...READ MORE

Jan 8 in Java by Frankie
• 9,810 points
85 views
0 votes
1 answer

How can we compare objects by multiple fields in Java?

You can implement a Comparator which compares two Person objects, and ...READ MORE

Jan 9 in Java by Daisy
• 8,050 points
51 views
0 votes
1 answer

Comparing Functions in Java

I would suggest that Version 1 is ...READ MORE

Jan 9 in Java by developer_1
• 3,300 points
40 views
0 votes
1 answer

How to convert a date string to a DateTime object using Joda Time library?

DateTimeFormatter formatter = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss"); DateTime dt = ...READ MORE

Jan 9 in Java by Daisy
• 8,050 points
44 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,880 points
1,234 views
0 votes
1 answer

Where do we get the maven dependency code for Spring Beans?

Don't worry, you can just go through ...READ MORE

Jan 8 in Java by Frankie
• 9,810 points
45 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,050 points
872 views
0 votes
1 answer

simple HTTP server in Java using only Java SE API

The com.sun.net.httpserver solution is not portable across JREs. Its ...READ MORE

Jan 4 in Java by Daisy
• 8,050 points
208 views
0 votes
1 answer

“Unable to load native-hadoop library for your platform” warning: How to resolve it?

If you are running Hadoop on 64bit CentOS, ...READ MORE

Jan 4 in Java by Daisy
• 8,050 points
199 views
0 votes
2 answers

How can I split the String with any whitespace character as delimiter?

String string = "Today's weather"; String[] arrayOfString = ...READ MORE

Aug 23 in Java by Sirajul
• 29,340 points
44 views
0 votes
2 answers

How do I convert an input stream into a byte array

You could probably try this if you ...READ MORE

Aug 29 in Java by Sirajul
• 29,340 points
484 views
0 votes
1 answer

How can I run test methods in specific order in JUnit4?

@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class SampleTest { ...READ MORE

Jan 7 in Java by Daisy
• 8,050 points
21 views
0 votes
2 answers

How to convert ArrayList<String> to String[] in Java

Try this:  String[] strArray = arrayList.toArray(new Stri ...READ MORE

Aug 21 in Java by Sirajul
• 29,340 points
71 views
+1 vote
10 answers

Hibernate hbm2ddl.auto possible values and their uses

hibernate.hbm2ddl.auto (e.g. none (default value), create-only, drop, create, create-drop, validate, and update) Setting to perform SchemaManagementTool actions automatically as ...READ MORE

Dec 7, 2018 in Java by Shuvodip
4,562 views
0 votes
1 answer

How to set JDK in Eclipse?

To manage the list of compilers go ...READ MORE

Jan 3 in Java by Daisy
• 8,050 points
46 views
0 votes
2 answers

How to convert byte array to String and STring to byte array?

The best possible way of conversion between byte[] and String is to ...READ MORE

Aug 22 in Java by Sirajul
• 29,340 points
71 views
0 votes
1 answer

How to include jars in classpath using command line?

I have tried the following and it's ...READ MORE

Jan 3 in Java by Daisy
• 8,050 points
45 views
0 votes
1 answer

What is the need to override the equals and hashCode methods in Java?

You must override hashCode() in every class ...READ MORE

Jan 2 in Java by Daisy
• 8,050 points
47 views
0 votes
1 answer

Getting error 404 not found when trying to download JDK

Try this command, it should work: wget --no-check-certificate ...READ MORE

Dec 26, 2018 in Java by Omkar
• 67,620 points
336 views
0 votes
1 answer

How to specify the certificate to use for authenticating the server to client?

You can try the command given below. System.setProperty("javax.net. ...READ MORE

Jan 2 in Java by Daisy
• 8,050 points
26 views
0 votes
2 answers

Fetch list of in-between dates using Java

java.time Package The new java.time.package in Java 8 incorporates ...READ MORE

Aug 21 in Java by Sirajul
• 29,340 points
98 views
0 votes
2 answers

Get all the permutations of a string in Java

You could use recursion to do this.  Try ...READ MORE

Aug 21 in Java by Sirajul
• 29,340 points
99 views
0 votes
2 answers

Result of character addition in Java

Binary arithmetic operations on char and byte ...READ MORE

Aug 22 in Java by Sirajul
• 29,340 points
54 views
0 votes
1 answer

3 dot in parameter in Java

The "Three Dots" in java is called ...READ MORE

Nov 21, 2018 in Java by geek.erkami
• 2,320 points
1,754 views
0 votes
1 answer

HashMap with multiple values under the same key

Use a map that has a list ...READ MORE

Dec 13, 2018 in Java by Sushmita
• 6,880 points
721 views
0 votes
1 answer

Is there any difference between ConcurrentHashMap and Collections.synchronizedMap?

ConcurrentHashMap: It allows concurrent modification of the ...READ MORE

Dec 26, 2018 in Java by Sushmita
• 6,880 points
103 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 in Java by anonymous
2,581 views
0 votes
1 answer

What is @ModelAttribute in Spring MVC?

@ModelAttribute refers to a property of the ...READ MORE

Dec 18, 2018 in Java by Daisy
• 8,050 points
438 views
+2 votes
1 answer

How to import an existing x509 certificate and private key in Java keystore to use in SSL?

keytool does not provide such basic functionality ...READ MORE

Dec 19, 2018 in Java by Daisy
• 8,050 points
294 views
+1 vote
2 answers

What is an Object?

Hey @preetiagarwal, your description is an answer ...READ MORE

Dec 24, 2018 in Java by Priyaj
• 56,900 points
46 views
0 votes
2 answers

What is the use of @Override annotation in Java ? When do we use it ?

@Override annotation is used when we override ...READ MORE

Aug 14 in Java by Sirajul
• 29,340 points
105 views
0 votes
2 answers

How do I replace character from string at specific indexes?

You could turn the String into a ...READ MORE

Aug 22 in Java by Sirajul
• 29,340 points
44 views
0 votes
1 answer

Where is JAVA_HOME on macOS Mojave (10.14) to Lion (10.7)?

export JAVA_HOME="$(/usr/libexec/java_home -v 1.6)" or export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)" or export ...READ MORE

Dec 4, 2018 in Java by Daisy
• 8,050 points
931 views
0 votes
2 answers

How can I convert an 'ArrayList<String> to 'String[]' in Java

In Java 8 or later: String listString = ...READ MORE

Aug 20 in Java by Sirajul
• 29,340 points
200 views
0 votes
2 answers

How can I invoke a method when the method name is in the form of a given string?

You could probably use method invocation from reflection: Class<?> ...READ MORE

Aug 19 in Java by Sirajul
• 29,340 points
62 views
0 votes
2 answers

what is the best way to convert an ArrayList to a String

You could probably use the Joiner class ...READ MORE

Aug 19 in Java by Sirajul
• 29,340 points
68 views
+1 vote
2 answers

Is there a code to find 64-bit JVM or 32-bit JVM (from within a program)?

Do I need to understand the difference ...READ MORE

Jun 11 in Java by Jim
• 810 points
266 views
0 votes
1 answer

3DES encryption/decryption in Java

Hey, its just that Base 64 encoding ...READ MORE

Nov 8, 2018 in Java by nirvana
• 3,060 points
1,977 views
0 votes
2 answers

What is the difference between Set and List in java?

LIST SET Duplicates YES NO Order Ordered Depends on Implementation Positional Access YES NO List is an ordered sequence ...READ MORE

Aug 14 in Java by Sirajul
• 29,340 points
117 views
0 votes
4 answers

How can we define global variables in java?

class G { static String globalVar ...READ MORE

Jan 29 in Java by zemiak
4,443 views
0 votes
1 answer

Unable to find valid certification path to requested target - error even after cert imported

Unfortunately - it could be many things ...READ MORE

Nov 27, 2018 in Java by Daisy
• 8,050 points
1,112 views
+2 votes
1 answer

How do I ask the Selenium-WebDriver to wait for few seconds in Java?

There are two ways to wait: explicit ...READ MORE

Dec 19, 2018 in Java by Daisy
• 8,050 points

edited Dec 19, 2018 by Daisy 62 views
0 votes
1 answer

Why doesn't RecyclerView have onItemClickListener()?

I like this way and I'm using ...READ MORE

Dec 21, 2018 in Java by Daisy
• 8,050 points
52 views
0 votes
2 answers

How to round any number to n decimal places in Java?

new BigDecimal(String.valueOf(double)).setScale(yourScale, BigDecimal.ROUND_HALF_UP); will get you a BigDecimal. To ...READ MORE

Aug 26 in Java by Sirajul
• 29,340 points
87 views