0

Convert?

Is there a way to convert JavaScript to Java? My teacher showed me a code in JavaScript and said I have to convert it into Java. I know both are different and maybe somewhat similar ( maybe I’m not 100% sure-) Also is there a website I can all of the commands(?) of code for Java and JavaScript so I can compare the two side by side to convert?

10th Sep 2021, 7:15 PM
Err3c
Err3c - avatar
3 Answers
+ 6
Javascript and Java are very different from each other. I doubt that there is a "converter" that safely translates the code. If the code is basic, it should be possible to rewrite it in Java.
10th Sep 2021, 7:19 PM
Lisa
Lisa - avatar
+ 4
jsweet A transpiler from Java to TypeScript/JavaScript http://www.jsweet.org Telerik Code Converter C# to VB and VB to C# https://converter.telerik.com Keep learning & happy coding :D
10th Sep 2021, 11:27 PM
SoloProg
SoloProg - avatar
+ 3
Your teacher probably meant that you should write a code in java that does the same as his javascript code. That basically involves two steps: 1. Abstract from the Javascript code to the logic. 2. Implement the logic in java code.
10th Sep 2021, 9:17 PM
Simon Sauter
Simon Sauter - avatar