Java learning : how many classes defined in java source, how many .class byte code files will be generated after compile via javac

One java source file generate one .class byte code file ?

False.
I thought one java source code file will generate only one .class byte code file, since I am a c++ programmer for about 10 years.
The correct answer is
how many classes defined in java source, how many .class byte code files will be generated after compile via javac
public class HelloWorld {
    class HelloInternal {
    }
}

enum HelloEnum {
}

interface HelloInterface {
}
javac HelloWorld.java
ls *.class
HelloEnum.class   HelloWorld$HelloInternal.class
HelloInterface.class  HelloWorld.class

Java classes

The classes can be any class, interface and enum.
All java codes should be placed in the classes.
otherwise you will get compile error
class, interface, or enum expected
In fact, enum is a class too, just a syntactic sugar.

Android java: How to display phonetic symbol with correct fonts via WebView ?

First, Download lingoes font file

Android default fonts can not display phonetic symbol.
lingoes.ttf can, please download it.

Second, Put lingoes.ttf to assets/font

assets_font_lingoes.ttf

Last, Add "lingoes" font-family in css files under assets

 @font-face {
    font-family: 'lingoes';
    src:url('file:///android_asset/fonts/lingoes.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
} 

Use "lingoes" as font-family for the phonetic symbol content

Android java : How to load html files in assets via WebView?

Android java : How to load html files in assets via WebView?

The base url for html files under the assets of your app is

"file:///android_asset/"

        WebView wv = new WebView(context);
        wv.getSettings().setJavaScriptEnabled(true);
        wv.loadUrl("file:///android_asset/coca/coca_00001_the.html");

Android java : How to copy/move file from assets to absolute path?

    private void moveAssets(String assets_file_path, String absolutePath) throws IOException {
        File wwwFile = new File(absolutePath);
        if (wwwFile.exists())
            return;
        InputStream is = activity.getAssets().open(assets_file_path);
        byte[] buffer = new byte[is.available()];
        is.read(buffer);
        is.close();
        wwwFile.createNewFile();
        FileOutputStream os = new FileOutputStream(wwwFile);
        os.write(buffer);
        os.close();
    }

TOP 16515 words from Corpus of Contemporary American English



Download for Android
https://play.google.com/store/apps/details?id=com.lengerrong.coca


Android java: How to orientation activity layout automatically ?

Add ~android:screenOrientation="fullSensor"~ to the activity

 AndroidManifest.xml activity android:name=".MainActivity"             android:screenOrientation="fullSensor" 

shell bash scripts : check process existed or not, if not existed then restart it

Put below scripts in your ~/.bash_profile or ~/.bashrc
It will auto run "unison" process if not running yet
when you open a new bash shell every time.
Change the process name "unison" for your case. :)
auto_unison() {
    u=`ps aux | grep unison | grep -v grep | wc -l`
    if [ $u -eq 0 ]
    then
        unison > /dev/null 2>&1 &
    fi
}
auto_unison

fixed: embedded-redis: Unable to run on macOS Sonoma

Issue you might see below error while trying to run embedded-redis for your testing on your macOS after you upgrade to Sonoma. java.la...