Is it possible to initialise an array in Java using the 'advanced' for loop?
e.g.
Integer[ ] numbers = new Integer[20];
int counter = 0;
for ( Integer i : numbers )
{
i = counter++;
}
for ( Integer i : numbers )
{
System.out.println(i);
}
This prints all nulls, why is that?
java-me uses the internet connection of the mobile device to implement network api's.
are there any special features in the implementation of tcp/ip protocol stack for mobile devices or the implementation is essentially the same with a little different parameters like buffer space etc.
lets take symbian for example.
I am new to regular expressions. I want to use java's replaceAll() function to replace any CSS comments in a string.
Basically I want to use regex to search for anything that is surrounded by "/*" and "*/" and replace it with "".
I need to create simple pagination of objects, but when I read manual I found out that query.setRange(5, 10); will fetch 10 objects, even when only 5 objects are needed.
Is there anyway to fetch just needed objects?
EDIT: I started bounty, so fi you can show me simple example code in Java that works, then I will accept you answer.
I need to use the logic contained in some java classes. I found JNI, but that project seems not updated recently.
Is there a way to use it in a Delphi native application? I use Delphi 2009.
Is it to possible to capitalize the letters in a Textfield as they are being typed by the user in Java?
E.g. The user would type 'hello' and 'HELLO' would appear in the Textfield.
(Odd request and I don't like the idea either.)
Greetings All,
Is there a way to expand the Java memory-mapped byte buffer such that the new size is reflected back to the mapped file on disk ?
Thank you !
Actually I'm working with BufferedImages, that provide me pixel values in int type.
Do you know a Java object to represent an image that the pixel value in double or float type?
Is there a representation of a graph in Java standard libraries, like there is in the boost library in C++? Is there a graph representation which is a standard in the business?
I'm looking for an example of a java desktop application that consumes a Two-way SSL secured web service. Any tutorials or examples would be great, especially if they are based on the Eclipse IDE.
Thanks.
In Java, is there any way to create an instance of any class that extends abstract class A, inside a member method of class A? Classes that extends abstract class A will return their instances with this method, but i don't want to implement same method in all subclasses with a "return this();" kind line.
I have a java.sql.ResultSet object containg data from a query that was run.
How do I refresh the data in the ResultSet to reflect the current data in the database?
Thanks!
I have an iPhone application and I am porting it over to Android.
I have a service/controller that spawns new threads to perform some network tasks.
I use performSelectorOnMainThread in my iPhone app. How can I have my Java app do the same or similar thing?
I'm taking user input from System.in using a java.util.Scanner. I need to validate the input for things like:
It must be a non-negative number
It must be an alphabetical letter
...etc
What's the best way to do this?
We are in web era standalone applications are almost gone everyone wants their internet application to run inside browser, programming languages like Ruby, Python and scala are becoming more and more mainstream.
Sometimes I wonder what these programming language offer which make them top choice of IT companies, if I plan to become a freelance web developer is it worth learning C# or Java. I read beginner's book for both of them, but to master any of them require some time investment.
In Java, to create and show a new JFrame, I simply do this:
public static void main(String[] args)
{
new JFrame().setVisible(true);
}
However, I have seen many people doing it like this:
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
new JFrame().setVisible(true);
}
});
}
Why? Are there any advantages?
Hi,
I am trying to send a file through a java socket and receive it through another. However, this happens:
Send Content:
/*
This is simply a file to transfer
*/
Received:
¨Ì
Hi
I'm new to java.
I'm trying to use some dynamically loaded classes in my application.
The application doesn't know classes , Just it try to load a class by name that its name came from input.
It doesn't know class (So I can't use casting) but just needs to call some methods of that class (every class should have that methods).
I thought about interfaces but I don't know how.
How can I call those methods?
Thanks
I have seen that there many books titled
1)Build Ecommerce website in php
2)Build shopping cars in php or asp.net
Is there any book which explains from scratch how to start building a website in java using any frame work or with servlets or jsp
like
1)Basic form with logins and registration
2)building catalogue system
3)Building shopping cart
4)Building newletters system
So i can strat reading it
hi, simple question :
I need to write cross platform application (basically CRUD).
Is usage of Java Swing good idea? Or is it out-dated and you know better solution?
I dont want to use like 5 languages for various stuff, one or two should be enough.
Thanx!
I'm trying to extend a Java Swing component in Clojure, i.e. I want to extend a javax.swing.JComponent and add some custom methods implemented in pure Clojure in addition to all the standard inherited methods.
I've tried using "proxy" which works great if I just want a single instance (in the same way as an anonymous inner class). However I'd really like a named class so that I can generate an arbitrary number of instances.
What's the recommended way of doing this?