JavaRush /Java Blog /Random EN /Cooler than T9
Джонни
Level 35

Cooler than T9

Published in the Random EN group
Switched to a new version of java. Configured variables, PATH variable. I check the functionality of java in the terminal: java -version It gives the version, everything is fine, it works. I check the functionality of the javac compiler in the terminal: javac -version zsh: command not found: javaс Oops... I double-check everything, it’s configured as it should. I went online, Googled the error, searched through a bunch of forums, stackoverflo, articles, guides, videos on YouTube, lost track of time - nothing helps! WHAT IS IT!? I wrote the code in notepad, tried to compile... IT WORKS! The compiler compiled the java class! Strange. It is impossible to find out the version, but the class compiles. Coincidence? I don’t think so :thinking: I check the version in the terminal AGAIN: ⇒ javac -version Voila! javac 11.0.2 Without hesitation, I discovered the idea and wrote the code:
String s1 = "javac";
String s2 = "javaс";

byte[] bytes1 = s1.getBytes();
byte[] bytes2 = s2.getBytes();

for (int i = 0; i < bytes1.length; i++)
{
    System.out.print(bytes1[i] + " ");
}

System.out.println();

for (int i = 0; i < bytes2.length; i++)
{
    System.out.print(bytes2[i] + " ");
}
I get the output: 106 97 118 97 99 106 97 118 97 -47 -127 Sighing and swearing, I turned off auto-switching layouts in Punto Switcher.
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION