Tagged Questions
Java is an object-oriented language and runtime environment (JRE). Java programs are platform independent, because they are compiled to bytecode and their execution is handled by a Virtual Machine called the Java VM or JVM.
2
votes
0answers
16 views
precedence of ~ and ++ in java
consider this code snippet
int j = 7;
System.out.println(Integer.toBinaryString(j));
j = ~j++;
System.out.println(Integer.toBinaryString(j));
prints
111
11111111111111111111111111111000
what i ...
0
votes
0answers
6 views
“Selection does not contain a main type”-errors appearing out of nowhere (they can be solved by restarting Eclipse). Why?
It sometimes happens when I'm working on a project that I suddenly get problems with running the program. When I press the keyboard shortcut for running as a Java application, I get the error message ...
0
votes
0answers
4 views
Unable to wildcards with SocketPermission for Tomcat Security Manager
I have defined a Security Manager for my web app in Tomcat. I need to grant access to my relational database in AWS. The hostname can change across deployments, so I would like to use a wildcard for ...
1
vote
2answers
23 views
Double click .jar file to launch it in command line
I'm trying to make one of my command line utilities a little more user friendly. Most of my co-workers don't mind using the utility as a CLI, but navigating to it is a bit of a pain (to them). I'd ...
0
votes
2answers
32 views
Java generics: compilation failure using captures
Why does the below code fail to compile? Can this example be simplified (to fewer classes) to demonstrate equivalent error?
The error message produced is:
func(capture of ? extends A) in ... cannot ...
0
votes
1answer
24 views
Alternative for '\f' char in Java?
I have an App that wirtes some texts in a file .Each five lines must be in distinct page.I have to use Dot Matrix Printers that invoke continuous pages also I use \f for indicating new page.There is ...
0
votes
0answers
9 views
EntityManager and ThreadLocal to create a transactional wrapper
In my J2SE/J2EE application I have a DAO interface to wrap around entity manager to allow simple CRUD operations. I also have an extended DAO interface that allows the simple CRUD operations to be ...
0
votes
1answer
32 views
Concurrent Cache in Java
Im looking for an explanation to the following code from Brian Goetz's concurrency book.
public V compute(final A arg) throws InterruptedException {
while (true) {
Future<V> f = ...
0
votes
1answer
21 views
Java from swing gui to system console?
All right for now I have this code:
package program.window;
import jaco.mp3.player.MP3Player;
public class obj {
private JFrame frame;
private static int xPosition = 30, yPosition = 30;
final ...
-2
votes
0answers
28 views
could I make a chronometer in java without using android?
I'm trying to do a chronometer in java, but without using android because I've never worked with it before. I tried to make a timer look like a chronometer, but it doesn't work...any suggest or idea ...
0
votes
0answers
6 views
Java equivalent of Mono.Cecil or .NET's reflection with access to MSIL code
I thought I'd automate error detection in future code, provided some of our code needs to explicitly release connection objects because of what we think is a bug in the Java HTTP API we use (not ...
1
vote
4answers
46 views
Java: NoSuchElementException when iterating through ArrayList
I want to delete duplicate elements and therefore iterate through a ArrayList and compare two consecutive elements. (Persons are comparable)
ArrayList<Person> persons = ...
0
votes
0answers
7 views
Loading JNI Dll
I have a file written as follows:
package JNI;
public class Natives {
public static final int PAGE_READONLY = 0x02;
public static final int PAGE_READWRITE = 0x04;
public static final ...
-6
votes
0answers
20 views
Error 100: When I open camera in 4.1.2 version. Lower versions are working well
In my project am recording video using front camera. Its working well in version 4.0.3 and lower versions.
But in 4.1.2 version shows error When open the camera. Can you have any solutions?
0
votes
0answers
3 views
Start a route on suspend state and scheduling the resume
I need the following behaviour for some Camel routes: a route must start in active state, but must also be suspended if the current time is between X AM and Y PM.
All the routes start with a timer in ...