char initial value in Java

Typically for local variables I initialize them as late as I can. It’s rare that I need a “dummy” value. However, if you do, you can use any value you like – it won’t make any difference, if you’re sure you’re going to assign a value before reading it. If you want the char equivalent … Read more

How can I convert my Java program to an .exe file?

javapackager The Java Packager tool compiles, packages, and prepares Java and JavaFX applications for distribution. The javapackager command is the command-line version. – Oracle’s documentation The javapackager utility ships with the JDK. It can generate .exe files with the -native exe flag, among many other things. WinRun4J WinRun4j is a java launcher for windows. It … Read more

Decompile .smali files on an APK [duplicate]

No, APK Manager decompiles the .dex file into .smali and binary .xml to human readable xml. The sequence (based on APK Manager 4.9) is 22 to select the package, and then 9 to decompile it. If you press 1 instead of 9, then you will just unpack it (useful only if you want to exchange … Read more

Difference between jar and war in Java

From Java Tips: Difference between ear jar and war files: These files are simply zipped files using the java jar tool. These files are created for different purposes. Here is the description of these files: .jar files: The .jar files contain libraries, resources and accessories files like property files. .war files: The war file contains … Read more

-XX:MaxPermSize with or without -XX:PermSize

We’ve run into a Java.lang.OutOfMemoryError: PermGen space error and looking at the tomcat JVM params, other than the -Xms and -Xmx params we also specify -XX:MaxPermSize=128m. After a bit of profiling I can see occasionally garbage collection happening on the PermGen space saving it from running full. My question is: other than increasing the -XX:MaxPermSize … Read more

Multiple assignment at once in java

tl;dr: No, there isn’t such a thing in Java. You can assign initial values to variables like this: But if your want (1, 2, 3) to be the result of a method call, this is not possible in Java. Java does not allow returning multiple values. Python allows this: The main point, why this does … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)