Java
-
How to use file. XML in Java Mkdirs () writes elegant code?
I need a directory to save the file, but I'm not sure if it exists File saveDir = new File("/tmp/appname/savedir/"); i…… -
How do I embed java code in JSF pages?
I have: In this JSF page, I have a login form Inside the managebean, I have a logincheck function public void loginChe…… -
Java – optimal solution of maximum single sales profit algorithm
The input array is: A[0] = 23171 A[1] = 21015 A[2] = 21123 A[3] = 21366 A[4] = 21013 A[5] = 21367 The mission is t…… -
Java generic problem
Can I write a method that can create an instance of any specified type? I think Java generics should help, so it might…… -
Java 8 avoids a large number of if / else statements
I have something that looks like this: public boolean isValidObject(SomeObject obj){ if(obj.getField() == null){ …… -
Use AutoCAD Library in Java to read DWG file?
Are there any open source Java or JavaScript libraries available for parsing DWG file and get objects from it I want t…… -
Java for loop problem
I'm making a java program to calculate Simpson's integral rules This is my code Note the second column of numbers in t…… -
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) …… -
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 simple leap year logic problem
public class LeapYear { public class LeapYear { public static void main(String[] args) { int year = Int…… -
Java – how to print arrays easily?
See English answer > What's the simple way to print a Java array? 32 System.out.print("["); for(int i = 0; i < a…… -
Java – reverse loop for array countdown
I received an error Exception in thread "main" java.lang.Arrayindexoutofboundsexception: 10 at Reverse.main(Revers…… -
Check the existence of Java in the file
I want to create a text file, but if the file already exists, I should not create a new file, but attach the text to t…… -
Java – load the keystore on OSX lion from the file created using keytool
I have a keystore whose key pairs are generated by the following command: keytool -genkeypair -v -alias test-agent -ke…… -
How to generate random numbers using Java in a given number list
Suppose I have a number / vector number, such as 1,3,7,9, and then I need to guess the number in this list at random U…… -
Java – business logic of the client
Why do people say that business logic should be implemented on server-side code (such as EJB) rather than on client-si…… -
ArrayList in Java
ArrayList<String> veri1 = new ArrayList<String>(); ArrayList<String> veri1 = new ArrayList<String…… -
Multithreading – I don’t understand multithreading programming
Someone can explain to me how a multithreaded application can be faster when a core CPU can only do one thing at a tim…… -
Java – generics: input variables?
In order to be able to replace a specific implementation, it is usually known to write List<AnyType> myList = ne…… -
Java – what is the purpose of using the toString () method in the following code?
See the English answer > how to override tostring() properly in Java? 11 This is my code: public class Gitfiddle { …… -
Constructor of Java subclass
When compiling this program, I get an error – class Person { Person(int a) { } } class Employee extends Person { …… -
Java – how do I resolve a string to int using default values?
See English answers > good way to encapsulate integer Parseint() 22 I've tried this, but it (? 0) doesn't seem to w…… -
Java – how to select a value from an array?
How do I select a value from an array? For example, string [] ans = {'', "– ''," / "," * "}; Then I want to choose "" …… -
Java – is there a way to disable hibernate optimistic locking?
I have one entity: @Entity public class VersionedDo { @Version @Column(name = "version") private int versi…… -
Java – applet – server communication, what should I do?
I have an applet and I have to send a request to the web application to get data from the server in the database I am …… -
Java – how does libgdx repeat the background?
A few days ago I figured out how to do some scrolling in libgdx Now I'm trying to do something related I want to repea…… -
Java – use Multimap instead of map to send parameters of rest assured call
I'm declaring a variable static Multimap<String,Object> multiList = ArrayListMultimap.create(); And add image mu…… -
Java – the swing button does not react immediately! How can I change?
I built a form with the visual editor of NetBeans When I press one of the buttons, it should do the following: >Set…… -
Java – error: “qualifier must be an expression” – Android studio
Activities: public class PreviewsFragment extends Fragment { private ViewPager mPager; @Override public View onCreat…… -
Java finds a specific letter for the first time
I am developing a program in Java I need to find specific text in the string Suppose the string is' hawaiie ' I need t…… -
How to send content and attachments using Abdera atom client
We use Abdera to interact with IBM connections API, but our problems are mainly related to Abdera itself I think there…… -
Java – httpclient authentication, keep login status
So my goal is to log in to the forum using HTTP client, and then post a reply post on the forum My login is good, but ……