What is Double Brace initialization in Java?

Java
What is Double Brace initialization syntax in Java?
3 years ago

c:out nested inside element attribute

Java
Is nesting a c:out JSTL tag inside an element attribute a good practice or is using the var attribute of c:out generally preferred? It seems to work ...
3 years ago

How to check if a java class has a particular method in it?

Java
I have an xml schema (generated automatically using trang) which keeps changing. These changes are not very elaborate. Only some elements are added or...
3 years ago

Can I send class as extra with intent?

Java
I'm trying to pass class name with extra, how to do that ? Intent p = new Intent(StartScreen.this, Setting.class); p.putExtra(" ",StartScreen.this); ...
3 years ago

In Java,Using switch statement with a range of value in each case?

Java
In Java is it possible to write a switch statement where each case contains more than one value? For example (though clearly the following code won't ...
3 years ago

Time gets changed when formating date to string in a particular format in java

Java
I have a date with value "Sat Nov 14 00:00:00 GMT+05:30 2015".I need to convert this variable to a string date with format "yyyy-MM-dd hh:mm:ss".For t...
3 years ago

Get next occurrence from RIGHT TO LEFT of a substring in a string (Java)

Java
Say I have a string s like this: s = "... *begin* - some-code-here - *end* ..." i: ^ and an index i pointing to a position betwe...
3 years ago

Index of Table Row in TableLayout

Java
I have a TableLayout and some unknown number of TableRows that are generated based on what's in the database. Every row has an OnClick listener attac...
3 years ago

Issue with printing space with single quotes in a int array in Java

Java
I want to print my int[] in a specific format (within space between each numbers, etc) However I found Java does not print the spaces in the single q...
3 years ago

Android Cursor NPE dumpCursorToString returns values

Java
As the title says, I'm experiencing a NullPointerException which occurs at the first getString() in the below method. For debugging I have used Databa...
3 years ago

How to properly use Java Executor?

Java
I've used Java Executors in my multi-threading apps, but I can't seem to figure out when is the best to use each of the following ways: 1. ExecutorS...
3 years ago

Java: How to get finished threads to pickup tasks from running threads

Java
I am working on a multithreaded application with tasks that have varying run times. When one thread finishes, is there a way for it to take over some ...
3 years ago

How to understand PriorityQueue?

Java
Here is My Code import java.util.*; public class PriorityPuzzle{ public static void main(String []args){ PriorityQueue<In...
3 years ago

Memory leak in Java?

Java
I was wondering if the following code produced some sort of memory leak in Java. Anyways here's the code: public class test { public static void ...
3 years ago

Why constructors can not be inherited in java?

Java
I am a beginner in java programming language, recently I have studied that constructors can not be inherited in java, Can anyone please explain why? ...
3 years ago

Finding all the common substrings of given two strings

Java
I have come across a problem statement to find the all the common sub-strings between the given two sub-strings such a way that in every case you hav...
3 years ago

Is the following flowchart correct for the given code?

Java
I have designed a flowchart that is based on this code in Java. public static void main(String args[]) throws IOException { BufferedReader bw = n...
3 years ago

how to message another agent at remote host using jade?

Java
I am a novice to JADE . I want to message an agent on remote host from another agent,but other than starting an agent platform from cmd i cannot figur...
3 years ago

Why is casting double to char allowed in Java?

Java
Why is char c = (char)65.8; allowed in Java? Shouldn't it throw an error since 65.8 is not an exact Unicode value? I understand that the double is tr...
3 years ago

Where is array's length property defined?

Java
We can determine the length of an ArrayList<E> using its public method size() , like ArrayList<Integer> arr = new ArrayList(10); int si...
3 years ago