Recent Posts
-
Where can I find Java main functions
Is public static void main (string [] args) a built-in or user-defined or overridden function of some classes provided…… -
Can I use variables in Java to name variables?
What I want to do is have a loop each time to name a certain number of variables Therefore, sometimes when I run the p…… -
Java – Android runs the functions in the class in a new thread
I have this Code: MyClass tmp = new MyClass(); tmp.setParam1(1); tmp.SetParam2("Test"); tmp.setParam3("Test"); ... The…… -
Java – how to use asserttrue?
I have: package com.darlik.test; import org.junit.Assert; public class Test { public static void main(String[] …… -
Java – why are different long values converted to the same date / time?
public static void getTime() { public static void getTime() { SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-M…… -
Java – is it acceptable to always use ‘this’ as a monitor lock?
For example, I have a class with 2 counters (in a multithreaded environment): public class MyClass { private int cou…… -
Java – how to convert dates to UTC
I need to change the date format to UTC format … I need to convert the LastModified date of the file in UTC format Sol…… -
Why does Java require char variables to use single quotes?
Why does Java require char variables to contain anything in single quotes instead of double? An example: char s = 's';…… -
Java – ArrayIndexOutOfBoundsException when iterating through all elements of an array
How to handle this exception "ArrayIndexOutOfBoundsException" public static void main(String [] arg) { int [] a=ne…… -
A list of all binary combinations of numbers in Java
I'm working on a project involving "dynamic programming". I'm shocked by this trivial thing. Please help Suppose I tak…… -
Java – byte constructor and byte Differences between valueof () methods
Byte byte1=new Byte("10"); Byte byte1=new Byte("10"); Byte byte2=Byte.valueOf("10"); System.out.println(byte1); Syste…… -
Java ternary operators and setting circular index values
I have a loop that traverses the for loop of ArrayList If the condition is met in the for loop: >I delete the curre…… -
Java – cannot inherit from final class
I just created my first Android library In another application, I want to extend a class from it But it shows an error…… -
Javac does not have openjdk-6-jdk installed
I've been trying out some different Java compilers over the weekend and decided to stick to javac this morning Then I …… -
Java – it is not a good practice to use arrays as parameters to return multiple values
I sometimes (actually, often) find myself using a single element array to return multiple values from a method Somethi…… -
Deprecated in Java 1.6
In Java 1.5, to discard a method, you will: @Deprecated int foo(int bar) { } Compiling in Java 1.6 results in the foll…… -
Java – a naming convention for variables that work like constants
I have a variable that I'm using like a constant (it never changes) I cannot declare it as a constant because the valu…… -
Java double gets all numbers after dot / comma
This is a simple task, but I can't solve it myself I have double digit1 = 12.1; double digit2 = 12.99; And need a …… -
Java and windows – error: illegal escape character
I have finished changing registry data Java file But I'm running runtime getRuntime(). An illegal escape character err…… -
Java: bad operand types
I'm a beginner. I'm sorry if this question is stupid I wrote the following code: public class Traindata { String City;…… -
Java – replace the contents in curly braces with something else (e.g. {1}) [copy]
See English answers > java: string formatting with placeholders 3 Hey {1},you are {2}. Here 1 and 2 are keys whose …… -
How many threads run in Java?
I have this wonderful idea to speed up the time required to generate 36 files: use 36 threads! Unfortunately, if I sta…… -
-
Java – about sorting algorithms applied to stacks and queues
I wonder why we always use sorting algorithms (such as insert sorting or merge sorting,...) only for lists and arrays?…… -
How to get value from Java enumerations
I have an enumeration that looks like: public enum Constants{ YES("y"),NO("N") private String value; Constants(…… -
Java – why do we have to declare dependencies on the JBoss 8 (wildfly) manifest?
The following ear is given: > my-app. ear > my-ejb. jar > my-webapp. war > lib > my-lib. jar My EJB nee…… -
How do I return flags and optional messages in Java?
I want to write a method in Java to verify whether some data exists for some conditions, confirm that the data is vali…… -
Java date() giving the error date
See English answer > java parsing string to date 1 It is obvious that there are not 43 days in February. I don't kn…… -
Can you comment on my java game?
I have marked this question as a community wiki, so no reply points will be thrown I made this game, forest defender, …… -
Java – design GUI for J2ME applications
How to create J2ME application for mobile phone using GUI similar to menu displayed in java game? I've tried using Net…… -
How to map a vector to a map and push duplicate key values into it?
This is my input data: [[:a 1 2] [:a 3 4] [:a 5 6] [:b \a \b] [:b \c \d] [:b \e \f]] I want to map this to the followi…… -
C command line strings like Java?
Is there any way to get the C string from the command line, just like in Java? public static void main(String[] args) ……