Questions for java


3866

Is Java's lack of unsigned primitive types a characteristic of Java the platform or Java the language?

There are questions about why Java doesn't support unsigned types and a few questions about dealing with unsigned types. I did some searching, and it appears that Scala also doesn't support unsigne...
3338

Code cannot find my file

I have written a short program that will find a file I have made and print some of its details. It executes all right, but it cannot detect the file size or if it is hidden or not. E.G.
1864

java has not enouth space, how to increase it?

I need to run a very big task in eclipse. So I changed the eclipse.ini to:
4364

Difference between value and itemvalue

What is the difference between the value and itemValue attribute of the radiobutton in Jsf?
9069

Format current date to show day of the week

I want to show the current date in my application like this:
9615

Performance difference between annotating fields or getter methods in Hibernate / JPA

I was curious if anyone had any hard numbers around the performance difference between annotating Entities using private fields instead of public getter methods. I've heard people say that fields ...
3035

Requesting a stack trace for a Java ThreadInfo?

I have an application that calls getStackTrace() on a java.lang.management.ThreadInfo object, but the StackTraceElement array produced by the invocation is zero length.
1817

How do I add this to an arraylist within a static method?

I'm learning the ropes with Java and I've hit a snag with ArrayLists. The gist of my program is to take some user input parameters, create a class Foo with those parameters, and then add it to an
671

how to convert double to string in android

i want to convert string in my constructor into double, i can't change it in my constructor, because in one process, the variable must in double, and other class must be string, can you tell me the...
7953

gnuprologjava problem

I am using http://www.gnu.org/software/gnuprologjava/ to perform prolog stuff from Java application.
7371

clever way to avoid try catch at each line

I am currently working with XML files, and am searching to have a better way to avoid try/catch blocks in a nice way.
1719

Can anyone quantify performance differences between C++ and Java?

Java was initially slow before the JIT but today performance is pretty close to C++. I want to know if someone has done measurable performance comparisons between the two languages? Where does Java
731

Array index out of bounds

I don't know what I'm missing... the full code is pretty big so I'll just put the part throwing exceptions here.
5159

why Dynamic method dispatch?

I am just want to know what is dynamic method dispatch in case of java and why do we need that in case of inheritance(what is the need of DMD) and Which one is better Polymorphism in C++ or DMD in ...
311

Generic OR instead of AND <T extends Number | CharSequence>

Is it possible to generically parameterize a method accepting EITHER ClassA OR InterfaceB ?
9124

Reflections library not working when used in an Eclipse plug-in

I have developed an application using the Reflections library for querying all the classes having a particular annotation. Everything was working like a charm until I decided to create an Eclipse p...
9966

Java's switch equivalent in Clojure?

Is there an equivalent for Java's switch construct in Clojure? If yes, what is it? If no, do we have to use if else ladder to achieve it?
4329

Java JTextArea Question

I am designing an on-screen form to be filled in, and I think it makes sense to stick it together as a collection of text areas. I note in the documentation of JTextArea that a text area can be
3872

Looking for an embeddable SQL beautifier or reformatter

I am looking for a Java open source beautifier or reformatter for SQL that I can use to clean up DDL statements that I am generating with openArchitectureWare.
3377

Getting to modify events on changes in file?

I am using Watch Service API of nio.2 classes to watch a specific directory( Ubuntu 11.10). whenever a change is made, for eg if I modify in existing file, it fires a MODIFIED event 2 times. Don't...
6278

How to code java jersey REST API with multi-leveled resources?

I want to code a REST API that is multileveled like:
9729

Is there a solution for generating a JSON SMD for a Spring 3 REST Controller?

A colleague and I are setting up an architecture for rapid development of rich client-side apps using REST and JSON. Our server is using Spring 3's MVC and REST features to expose REST services as
8324

Is there any alternative to Java properties for keeping tree-like data?

I have 3 item data that I should keep on remote PC. Let it be: ID, login, password.
7923

Multiple calls, one timer

I've been struggled this java problem for some hours, which i first thought was quite easy.. -.-
3916
8477

Is there any API for constraint based programming in java

Is there any API available for Constraint Based programming in java.
5514

Set System propery to Null in Java

In my unit tests I need to set the "workingDir" system property to Null.
4102

If construct in hashmap.put call

I have a variable of type Hashmap&lt;String,Integer>.
1902

Which opensource java or .net project has best unit test coverage?

I want to dive more into the unit testing concepts. An open source project which will illustrate the best practices in unit testing is required.
1959

How to set up a form in a Spring app that pulls data from different tables

I'm developing a Spring web app and am hoping someone can give me some advice. Currently I've got a form that when submitted populates a simple POJO that is stored in a database. That POJO needs to...
1028

show timing as per own country (and not as per server time)

I am creating web application where I need to store timestamp/ date.
2480

how to pass the value of a variable that is created in the class A in class B

I need to pass the value of a variable That Is created in a class A to a class B. I'm still a beginner and I can not figure out how to proceed. Could you give me a hand?
2399

Fix to grow a square based on user input

I wrote two classes. The main class runs the program. It asks for user input. Based on user input, the second class will print out a square. Each square will print out ---- for every number and |...
8087

JasperReports: access custom data source

I am quite new to JasperReports and I need to create a report from a custom data source. For this I implemented the JRDataSource interface, with the two methods:
9927

Java: How to pass byte by reference?

You can do it in .NET by using the keyword "ref". Is there any way to do so in Java?
2729

Displaying a progress dialog until new activity loads

I have a progress dialog I am trying to show when a user clicks a button to launch a new activity. The spinner should be displayed on the current page until the other activity appears. ( The activi...
3303

JAVA: 128-bit key to String problem and back

I have created a SecretkeySpec object wich contains a 128 bit key.
4038

Struts 2 decorator question

I'm building a website with struts 2. I got a decorator for the layout of my website and I fill the content according an action. I also want to use a column with some tools like login, latest messa...
8326

Get information from HTML by identifying tags

All- I have never done this sort of thing before and am very confused. I have spent hours on Google looking for some example code or any hints but whenever I try to work with the available code I a...
1447

Get visual graph of heap memory usage in Java over a span of time

I am currently using Visual VM to monitor the heap memory usage of my Java application. However I would like to somehow see the heap memory usage over a span of time like for example a day and not ...
4138

Calculating the value of a mathematical function in Java

I have this function and I was trying to get a list of all the calculations.
6674

What sort of database will I get with an Apache Wicket Application?

So I've done my Object Oriented design, put together a database schema to go with my design, and promised an impossibly short deadline for delivery I've decided to make my life "easier" by using a ...
584

JUnit test for console input and output

I have only one method main. How to check System.out.println() and replace Scanner to input values automatically using JUnit?
4556

Javadoc and linking to a file on a UNC Path

Might sound crazy, but I was wanting to link some javadoc documentation to a file that exists on the network. This is accessed from a standard UNC path.
9695

How to get the invoker name in EJB interceptor's lifecycle event method

I use Java EE 5. I wrote an interceptor for all EJBs with three methods for logging:
6515

how can i pass my instance variable througout my entire activity?

I am trying to make a custom list view adapter. In my public void function I am trying to set the adapter.. (after make the list from the web
4110

How to get line number in ANTLR3 tree-parser @init action

In ANTLR, version 3, how can the line number be obtained in the @init action of a high-level tree-parser rule?
8614

Changing NetBeans UI Look/Feel

Is it possible to somehow change the look/feel of NetBeans? I know it uses Swing and that usually apps using Swing for its UI can usually have their UI scheme changed.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.