Trending questions in Java

0 votes
2 answers

How to convert a JSON String into Object in Java?

You could probably check out Google's Gson: ...READ MORE

Aug 21, 2019 in Java by Sirajul
• 59,230 points
3,260 views
0 votes
1 answer

What is JNI?

Java native interface, it is an interface ...READ MORE

Mar 7, 2019 in Java by Priyaj
• 58,020 points
1,009 views
0 votes
1 answer

SuppressWarnings (“unchecked”) in Java

@SuppressWarnings("unchecked") is used when Java generics just don't ...READ MORE

Sep 4, 2018 in Java by anto.trigg4
• 3,440 points
8,907 views
0 votes
1 answer

How to install and configure JDK8 on Windows 10

Hey @Henna, Go to this page  Accept the license ...READ MORE

Feb 28, 2019 in Java by Kalgi
1,253 views
0 votes
1 answer

Getting "Unsupported major.minor version" error.

I will recommend not to upgrade the ...READ MORE

Feb 22, 2019 in Java by Sapan
1,512 views
0 votes
1 answer

What are the different ways of comparing Strings in Java?

The different ways of comparing string in ...READ MORE

Mar 5, 2019 in Java by Wasim
986 views
0 votes
1 answer

Http Basic Authentication in Java using HttpClient?

String encoding = Base64Encoder.encode ("test1:test1"); HttpPost httppost = ...READ MORE

Dec 20, 2018 in Java by Daisy
• 8,140 points
4,224 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, 2019 in Java by Sirajul
• 59,230 points
3,601 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, 2019 in Java by Sirajul
• 59,230 points
3,848 views
0 votes
1 answer

How to remove object from an Array?

Here is a code I came up ...READ MORE

Mar 11, 2019 in Java by Esha Gupta
671 views
0 votes
1 answer

How to disable session in JSP?

<%@ page session=“false” %>    Using this above command, you can ...READ MORE

Feb 18, 2019 in Java by Frankie
• 9,830 points
1,535 views
0 votes
1 answer

How to run Unix shell script from Java code?

ProcessBuilder pb = new ProcessBuilder("myshellScript.sh", "myArg1", "myArg2"); ...READ MORE

Oct 26, 2018 in Java by Daisy
• 8,140 points
6,496 views
+1 vote
1 answer

Convert CSV to JSON. JSON payload should be included in square brackets

The JSON payload uses a list and ...READ MORE

Aug 7, 2018 in Java by Omkar
• 69,220 points
9,984 views
0 votes
1 answer

finalize() called on strongly reachable object in Java 8

A bit of conjecture here. It is ...READ MORE

Mar 5, 2019 in Java by developer_1
• 3,350 points
824 views
0 votes
1 answer

What is the difference between Polymorphism, Overriding and Overloading?

As far as I know, the main ...READ MORE

Jun 19, 2018 in Java by scarlett
• 1,290 points
11,990 views
0 votes
1 answer

Need help with Java Installation

Hi @Ashmita, to asnwer your question, lets ...READ MORE

Feb 28, 2019 in Java by Pratibha
• 3,690 points
1,019 views
0 votes
1 answer

How to Read/Write String from a File in Android

Writing a File in android: private void writeToFile(String ...READ MORE

Oct 3, 2018 in Java by sharth
• 3,370 points
7,366 views
0 votes
1 answer

Xpath in Java for accessing OWL Document

Don't query RDF (or OWL) with XPath In ...READ MORE

Feb 28, 2019 in Java by developer_1
• 3,350 points
918 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, 2019 in Java by Daisy
• 8,140 points
3,339 views
0 votes
1 answer

Under what conditions is a JSESSIONID created?

JSESSIONID cookie is created/sent when session is ...READ MORE

Dec 18, 2018 in Java by Daisy
• 8,140 points
3,975 views
0 votes
1 answer

Trusting all certificates using HttpClient over HTTPS

Note: Do not implement this in production ...READ MORE

Jun 25, 2018 in Java by Rishabh
• 3,620 points
11,557 views
0 votes
2 answers

How can I convert byte array into hex string in Java?

public static String byteArrayToHex(byte[] a) { ...READ MORE

Aug 29, 2019 in Java by Sirajul
• 59,230 points
2,922 views
0 votes
1 answer

What is composition in Java?

Composition is again specialized form of Aggregation ...READ MORE

Feb 18, 2019 in Java by Neha
• 6,300 points

edited Feb 18, 2019 by Neha 1,285 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,140 points
4,828 views
0 votes
1 answer

Compiling error in Java

Generally the file name and the class ...READ MORE

Mar 7, 2019 in Java by Priyaj
• 58,020 points
519 views
0 votes
1 answer

Rotate elements of array by n position

Here is what I came up with,  import ...READ MORE

Mar 3, 2019 in Java by Priyaj
• 58,020 points
660 views
0 votes
1 answer

How to break a number to individual digit?

The best way would be find the ...READ MORE

Mar 7, 2019 in Java by Priyaj
• 58,020 points
465 views
0 votes
1 answer

Arrays are passed by value or passed by reference in Java?

Arrays are not a primitive type in ...READ MORE

Jul 18, 2018 in Java by sophia
• 1,400 points
10,379 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, 2019 in Java by Sirajul
• 59,230 points
3,471 views
0 votes
1 answer

How to use nested class in Java?

This program will help you understand the ...READ MORE

Mar 3, 2019 in Java by Priyaj
• 58,020 points
544 views
0 votes
2 answers

What is the easiest way to iterate through the characters of a string in Java?

There are two approaches to this: for(int i ...READ MORE

Aug 19, 2019 in Java by Sirajul
• 59,230 points
1,844 views
0 votes
1 answer

Mathematical Operations in Java

Ok. This is happening because you're dividing ...READ MORE

Feb 28, 2019 in Java by developer_1
• 3,350 points
655 views
0 votes
1 answer

Architecture mismatch between driver and application

None of these did it for me. ...READ MORE

Feb 6, 2019 in Java by developer_1
• 3,350 points
1,548 views
0 votes
1 answer

Use annotation for excluding specific fields from serialization

Simply mark the desired fields with the ...READ MORE

Feb 1, 2019 in Java by developer_1
• 3,350 points
1,767 views
0 votes
2 answers

Why are you not able to declare a class as static in Java?

A static keyword  can be used with ...READ MORE

Jun 11, 2019 in Java by Neha
• 330 points
1,481 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
• 69,220 points
3,321 views
0 votes
1 answer

How to parse date string to Date?

The pattern is wrong. You have a ...READ MORE

Oct 29, 2018 in Java by Daisy
• 8,140 points
5,779 views
+1 vote
1 answer

Error: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2

Hello @Jino, It is just a JVM bug ...READ MORE

Nov 21, 2018 in Java by Nabarupa
4,723 views
0 votes
1 answer

Lazy Initialization Error in Java

What is wrong here is that your ...READ MORE

Jan 14, 2019 in Java by developer_1
• 3,350 points
2,400 views
0 votes
2 answers

How to convert an int array to string using tostring method in java?

Use java.util.Arrays: String res = Arrays.toString(array); System. ...READ MORE

Aug 16, 2019 in Java by Sirajul
• 59,230 points
2,398 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, 2019 in Java by Daisy
• 8,140 points
2,499 views
0 votes
0 answers

How execute JSP web page in Intellij

Hi all, I am new to java and ...READ MORE

Jan 24, 2019 in Java by Abraham
• 120 points

edited Jul 11, 2023 by Khan Sarfaraz 1,889 views
0 votes
1 answer

What do you mean by aggregation in Java?

Aggregation is a specialized form of Association ...READ MORE

Feb 18, 2019 in Java by Frankie
• 9,830 points
776 views
0 votes
0 answers

how to solve thread-cannot find symbol

Feb 11, 2019 in Java by anonymous
1,089 views
0 votes
0 answers

What is the difference between Default and Protected access specifiers?

Can anyone explain in brief as what ...READ MORE

Feb 6, 2019 in Java by Dishantu
1,288 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,140 points
3,411 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, 2019 in Java by Sirajul
• 59,230 points
3,290 views
0 votes
1 answer

Xml to Json Conversion

To convert XML File in to JSON ...READ MORE

Jan 10, 2019 in Java by developer_1
• 3,350 points
2,390 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 9, 2019 in Java by Frankie
• 9,830 points
2,445 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, 2019 in Java by Sirajul
• 59,230 points
3,068 views