Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

what is the way of writing java code for converting into javascript?

 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do we need to follow any specific way to writing a java code for converting in Javascript or ?

let say I need a function which returns me the time & Date in javacript.
in a simple way we write a main methods and use Date class of util package to get this.
code Example:


what would be the output of this program in javascript file by using GWT? is this file will convert into javascript?
 
author
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to follow the GWT way, as you will be using the Java to Javascript compiler provided by GWT to actually do the conversion. You will not be using main methods, but will instead use GWT modules and entry points.

thanks
prabhakar
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Prabhakar Chaganti:
You will need to follow the GWT way,



can you provide me any link of it,

Thanks in Advance.
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic