Tagged Questions
Java, not to be confused with JavaScript, is an object-oriented language and runtime environment (JRE). Java programs are compiled to bytecode and run in a virtual machine (JVM).
0
votes
3answers
24 views
For each loop: can we populate an array?
I can read data from an array with for each syntax:
int[] a = new int[100];
for (int i = 0; i < 100; i++){
a[i] = i;
}
for (int element : a){
System.out.println(element); ...
0
votes
0answers
6 views
Getting the text from programatically opening the android keyboard
I have opened the keyboard using this:
InputMethodManager mgr = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(view, ...
0
votes
0answers
12 views
Java Web Server
I am trying to build my simple webserver in java. So I found this code in tutorial
I was trying to understand what does this method do but I could not any one can explain
what is the use of ...
0
votes
1answer
6 views
Money data on postgresql using java
I'm writing a java program that mines currency exchange data. The data can have multiple numbers to the decimal such as "0.973047". After some research I was able to find out BigDecimal is the right ...
0
votes
0answers
15 views
I can't get a ListView to display the names of files in a folder
Thanks in advance for any help,
I'm trying to get a listview on the main activity to display the names of files in a folder, despite doing research here and on tutorials, I just can't get if to work ...
-1
votes
0answers
32 views
Count Value in Nested For Loops
What is the approach to solve nested for loops?
Ex1 -
for(i=0;i<10;i++)
for(j=i+1;j<10;j++)
for(k=j+1;k<10;k++)
for(l=k+1;l<10;l++)
for(m=l+1;m<10;m++)
count++;
gives 252
Ex2 -
...
1
vote
1answer
12 views
What is the better way of publishing global constants in Java?
Which one of these ways of publishing global constants is better? THANKS!!!
Method 1: final class with public static final fields
public final class CNST{
private CNST(){}
public static ...
1
vote
2answers
18 views
How can I programmatically generate keypress events?
What the java program should do is it should trigger keyboard press on some condition without a person pressing a keyboard key. So any program running in windows and in focus which requires keyboard ...
1
vote
4answers
20 views
ArrayList shows diffrent time of execution each time why?
I was working with ArrayList and trying to add new object at starting of ArrayList of a prepopulated ArrayList having 3000000 record all ready.
According to my knowledge it will add new object at ...
0
votes
4answers
24 views
Template Classes when instance variables necessary
I'm trying to make use of a parent class to reuse in multiple inheriting classes, but the parent class needs to have an instance variable to work.
public class Num {
private int a = 1;
...
0
votes
1answer
29 views
Build Jar File with multiple classes
Is there a way to build a jar file that is anything inside a specific folder?
Inside my folder I have my main class named "GamesCombined.java" with it's .class files
Here's what my directory looks ...
1
vote
1answer
14 views
getExternalStorageDirectory() to getExternalFilesDir()
So, basically I have this code (all credits to mburhman's File Explorer - https://github.com/mburman/Android-File-Explore):
private File path = new File(Environment.getExternalStorageDirectory() + ...
0
votes
1answer
25 views
How to disable submit button if checkbox is unchecked?
First of all I did not make this code and I am not a java programmer, I just modified this from a "feedback form" page into a "request form" page. My goal here is to disable the submit button and ...
0
votes
0answers
9 views
How to redirect secondary URL to primary URL using Tuckey URLRewrite Filter?
I've two domain names primary.com and secondary.com. Both point to the same app. The secondary should always be redirected to primary.
So I've used Tuckey URL Rewrite Filter to do the domain ...
2
votes
1answer
11 views
org.apache.commons.net.ssh documentation
It's weird! I searched for "org.apache.commons.net.ssh documentation", and there's nothing there. I mean there's not even an entry for ssh in http://commons.apache.org/proper/commons-net/
however I ...