I am using java.util.Scanner for things such as nextInt(), and all was working fine as long as I was using a java.lang.Readable (one and only constructor argument). However, when I changed to using an InputStream instead, Scanner.nextInt() never returns. Do you know why?
My implementation of the InputStream looks like this:
private sta...
How can I know what exceptions might be thrown from a method call?
...
Hi,
See Eclipse Java Search screenshot
.
I googled a lot, tryied my best but could not find any ways to tell Netbeans to search for method invocation in JRE / Application libraries.
Let's consider:
I have maven project with ApplicationA being runtime
ApplicationA* artifat defines interface InterfaceA with method methodA
I'm impleme...
Possible Duplicates:
Cheat single inheritance in Java !!
Why is Multiple Inheritance not allowed in Java or C#?
Multiple Inheritance in java.
I know that we can use interfaces to inherit from multiple classes but is it possible to inherit the state as well?
How can I inherit methods with definitions from 2 classes and have t...
Im coming from PHP world and im so confused about how to think when you declare objects in java.
so when traditionally you do like this:
Rectangle rect = new Rectangle();
cause rect is a Rectangle datatype.
According to the java tutorial page a number wrapper class is a subclass to Number.
So its a class but when you instantiate it...
This may be a dumb question, but I couldn't find it anywhere:
How can I use the java OR regular expression operator (|) without parentheses?
e.g:
Tel|Phone|Fax
...
Hi,
I'm trying to set up a large number OnClickListeners through a for loop. Each view should run a method when clicked; view 0 should run the method with the value 0, view 1 with the value 1, etc. However, if I declare the OnClickListener using a variable which increments through the for loops, the OnClickListener remembers the referen...
After following some instructions on Diego Torres blog I am able to test my classes using the regular Eclipse JUnit test-runner, however I also want to be able to run my unit tests from within the emulated android environment.
For now this should make no real difference since the classes I am working on do very basic numerical or netwo...
The code comes from "Hello Android" Page47. I am using 1.6 since that is what the book is written for.
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
/** Called when the activity is first created. */
e1 @Override
e2 publ...
According to the entry at MVNRepository, at the time of this writing, the latest version in maven central is 1.0-rc5. I am aware there are no changes between 1.0 which was recently announced and RC5, but I guess the nit picker in me wants to find a 1.0 version. Here's the POM entry for RC5.
<dependency>
<groupId>com.google.collect...
I've created a java.nio.MappedByteBuffer around a java.io.RandomAccessFile (a file which is only 54 KB in size). The resulting MappedByteBuffer has a "capacity" and "limit" of around 12 KB, so when I try to invoke mybytebuffer.get(i > 13044) or mybytebuffer.put(i > 13044, value) it throws an InvalidIndexException.
All of this behavior i...
So I'm developing an app for android, and before I get too much into it, I want to conceptually get my arms around what I am trying to do. Is it very difficult to calculate or track the most frequently accessed apps? Any ideas or insights about how I might go about getting this done would be greatly appreciated! I'm used to iphone develo...
in php you can declare a function in a global scope with function.
is this not possible in java? looks like every function is in a class as a method. so everything is OOP in java? no procedural code?
...
Hey, im trying to override the method onConfigurationChanged and I get the error:
The method onConfigurationChanged(Configuration) of type BaseActivity must override or implement a supertype method
Here is my BaseActivity.java:
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.Vi...
I'm porting over a Java project that I wrote which uses the Apache Commons StringEscapeUtils class (particularly the
escapeXml
unescapeXml
escapeHtml
unescapeHtml
methods). Is there a .Net equivalent? Or perhaps some totally logical bit of C# code that accomplishes the same thing?
...
I need to determine if an unknown 5 or 6 letter string is a valid word, i.e. is in the dictionary. I could submit the string/word to an online dictionary, but I need to check this string/word, which will be different each time, for about 100 to 150 times. This seems to be a bit time consuming.
My next thought would be to try to get a di...
(SOLVED: a WindowStateListener and a deferred call to toBack whenever the window is focused)
Hello all!
I've been trying to figure out how to make a java.awt.Window (any subclass will do) so that it cannot be brought to the front. I'm working on a Java "Samurize-like" program that appears below all the application windows and displays ...
we have a requirement to protect pdf files using a password, are there any java based open source tools which will help us in this regard?
...
The objectives and sections are listed here:
http://www.sun.com/training/catalog/courses/CX-310-065.xml
I've been using the Sun Certified Programmer for Java 6 Study Guide, which lists objectives as well that are close to those on the Web site, but they also have "sub-objectives" in the book that appear to be somewhat manufactured. Wil...
I am not trying to duplicate threads here.
My problem is i am piping in a file using msdos called amazon.txt
the file has 637 words in it..
I want a count of unique words.. and not a count of "a", "the" , "this"
which i havent counted for yet in the code..
when i add to a tree set it only has 8 words..
There should be atlest 300 unique ...