Trending questions in Java

0 votes
1 answer

which maven dependency has to be added for MongoPreparedStatement in java 1.8

You need to define the dependency of a ...READ MORE

Jul 30 in Java by Sirajul
• 36,220 points
58 views
0 votes
2 answers

What is the difference between Map and HashMap in java?

The basic difference is : Map is ...READ MORE

Aug 28 in Java by Sirajul
• 36,220 points
597 views
0 votes
1 answer

What is Comparable in Java?

As the name itself suggests, Comparable is an interface which defines ...READ MORE

Jul 15 in Java by Neha
• 6,280 points
46 views
0 votes
1 answer

What is Just in time compiler in Java?

The Just-In-Time compiler is one of the integral parts ...READ MORE

Jul 14 in Java by Frankie
• 9,810 points
37 views
0 votes
1 answer

What do you mean by Socket Programming?

Socket programming is a way of connecting two ...READ MORE

Jul 14 in Java by Frankie
• 9,810 points
33 views
+1 vote
4 answers

What is difference between access modifier and access specifier in java

Access Specifier:- This can be understood as ...READ MORE

Feb 14 in Java by Priyaj
• 56,900 points
5,744 views
+1 vote
0 answers

Initially autowired object has value,it becomes null after paging(using JSF 2.2 and spring 4.01.)

i'm trying to create basic crud operations ...READ MORE

Jul 5 in Java by swats
95 views
0 votes
1 answer

i am getting sessionnotcreatedexception in appium

Hi... it says here that Appium cannot ...READ MORE

Jun 27 in Java by ajs3033
• 7,280 points
56 views
+1 vote
1 answer

Can you please explain the difference between string, string buffer and string builder?

String are immutable where as StringBuffer and ...READ MORE

Jul 4 in Java by Akash
• 160 points
90 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 in Java by Omkar
• 67,660 points
1,088 views
0 votes
0 answers

Sending request using json object return 404 error code

I am getting mad with this code ...READ MORE

Jun 19 in Java by FooBayo
• 120 points

edited Jun 19 by FooBayo 96 views
0 votes
1 answer

Abstract class provides partial abstraction. How?

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

Jun 25 in Java by Sirajul
• 36,220 points
71 views
0 votes
2 answers

How to take input using BufferedReader in Java?

Reading User's Input using BufferedReader class: By wrapping ...READ MORE

Aug 16 in Java by Sirajul
• 36,220 points
620 views
0 votes
1 answer

GSON throwing “Expected BEGIN_OBJECT but was BEGIN_ARRAY”?

This will work: ChannelSearchEnum[] enums = gson.fromJson(yourJson, ChannelSearchEnum[].class); But ...READ MORE

Dec 26, 2018 in Java by Sushmita
• 6,880 points
7,010 views
0 votes
2 answers

Reverse an Array in Java

If you want to reverse the array ...READ MORE

Aug 28 in Java by Sirajul
• 36,220 points
44 views
0 votes
1 answer

How can I make my output float when my two integers are integer?

Hi Prapti , I got your doubt please check ...READ MORE

Jun 3 in Java by sampriti
• 1,100 points
34 views
0 votes
2 answers

How to rotate an array from a particular index?

private static void rotate(int[] arr, int order) ...READ MORE

Aug 29 in Java by Sirajul
• 36,220 points
29 views
0 votes
2 answers

What is the difference between string object and string literal?

A String literal is a Java language concept. This ...READ MORE

Aug 16 in Java by Sirajul
• 36,220 points
368 views
0 votes
1 answer

How can I compare two integers properly?

Hi Divya, I hope this code snippet will ...READ MORE

May 31 in Java by sampriti
• 1,100 points
34 views
0 votes
1 answer

How to Iterate HashMap?

Hi Shashank. Please try this code I hope ...READ MORE

May 30 in Java by sampriti
• 1,100 points
27 views
0 votes
0 answers

Where i have to put resource package so it's accessible by external jar in eclipse?

Servlet.init() for servlet [JERSEY] threw exception java.lang.ExceptionInInitializerError cause by ...READ MORE

May 29 in Java by anonymous

edited May 30 by Omkar 39 views
0 votes
1 answer

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

Yes its possible. I had installed tomcat ...READ MORE

May 28 in Java by arvind.phulare1911
• 180 points
37 views
0 votes
1 answer

Can Enum implement Class

Enum is a type similar to that ...READ MORE

May 27 in Java by Sirajul
• 36,220 points
32 views
+1 vote
10 answers

How to make mock to void methods with mockito

You can use partial mocking to serve ...READ MORE

Dec 7, 2018 in Java by nitesh
10,597 views
0 votes
2 answers

“Cannot find symbol” compilation error

The "Cannot find symbol" errors generally occur when you ...READ MORE

Apr 3 in Java by patricblues
• 140 points
8,776 views
0 votes
1 answer

Should a class file always be inside package for importing it in jsp page?

Hey there! It is not necessary for the ...READ MORE

May 24 in Java by Karan
53 views
0 votes
2 answers

Converting between java.time.LocalDateTime and java.util.Date

Try this: Date in = new Date(); LocalDateTime ldt ...READ MORE

Aug 27 in Java by Sirajul
• 36,220 points
184 views
+1 vote
2 answers

Non-static variable cannot be referenced from a static context. Explain?

class Program { int count ...READ MORE

Sep 27 in Java by anonymous
5,097 views
+1 vote
0 answers

How to install java on linux operating system? [closed]

I read good info about java here ...READ MORE

May 16 in Java by Vicky

closed May 16 by Vardhan 36 views
0 votes
1 answer

What are the different types of database testing?

The 3 types of Database Testing are Structural ...READ MORE

May 9 in Java by Frankie
• 9,810 points
75 views
0 votes
2 answers

How to ignore exception in Java?

There is no way to basically ignore a ...READ MORE

Aug 16 in Java by Sirajul
• 36,220 points
515 views
0 votes
2 answers

Why it is not possible to define a static method in a Java interface?

Interfaces are concerned with polymorphism which is ...READ MORE

Aug 27 in Java by Sirajul
• 36,220 points
88 views
0 votes
1 answer

How to refresh data in ViewPager Fragment ?

Using the ViewPager.OnPageChangeListener is the correct way to go, ...READ MORE

Mar 6 in Java by developer_1
• 3,300 points
2,481 views
0 votes
1 answer

How to download Eclipse on a flash drive and use it on a public computer?

To use Eclipse from a flash drive, ...READ MORE

Apr 22 in Java by Omkar
• 67,660 points
387 views
0 votes
1 answer

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

The proper syntax to run a jar ...READ MORE

Apr 22 in Java by Omkar
• 67,660 points
291 views
0 votes
1 answer

How can I solve this: To prevent a memory leak, the JDBC Driver has been forcibly unregistered

What can you do? Ignore these warnings. Tomcat ...READ MORE

Jan 8 in Java by Daisy
• 8,050 points
4,723 views
+1 vote
2 answers

How to use try & catch block in Java?

Hey @Jino, Using try catch block for your ...READ MORE

Dec 21, 2018 in Java by Nabarupa
56 views
+1 vote
2 answers

What is coercion in Polymorphism?

Implicit type conversion is called coercion polymorphism. ...READ MORE

Jun 25 in Java by anonymous
188 views
0 votes
2 answers

How to iterate in a HashMap in Java?

Iterating using Iterator. Using Generics: Map<Integer, Integer> map = ...READ MORE

Aug 28 in Java by Sirajul
• 36,220 points
56 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 in Java by Sirajul
• 36,220 points
975 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

Mar 27, 2018 in Java by DragonLord999
• 8,380 points

edited Nov 6, 2018 by Omkar 10,074 views
0 votes
3 answers

How can I separate the digits of an int number in Java?

import java.util.*; public class AmstrongNumber { public static void ...READ MORE

Aug 6 in Java by anonymous
4,818 views
0 votes
2 answers

Maximum size of an Java array

There are actually two limits.  The maximum element ...READ MORE

Aug 20 in Java by Sirajul
• 36,220 points
648 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 in Java by Sirajul
• 36,220 points
163 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,050 points
4,050 views
0 votes
2 answers

How to move or copy a file in Java

The new JAVA Specification Request 203 -NIO will ...READ MORE

Aug 20 in Java by Sirajul
• 36,220 points
39 views
0 votes
2 answers

Java: convert List<String> to a String

With a java 8 collector, this can ...READ MORE

Aug 30 in Java by Sirajul
• 36,220 points
35 views