Results 1 to 3 of 3

Thread: Ruby to Java

  1. #1
    pierovera is offline Member
    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

    Default Ruby to Java

    Hi everyone,

    So I didn't find where to post this, so I came here. I am not too skilled in Java and I wanted to know how to translate this piece of Ruby code to Java so I can get the same output:

    a=0.0
    m=1.306377883863
    p=3.0

    def calc(a,m,p)
    while a!=10
    a=a+1
    b=m**p**a
    b=b.floor
    print "Mills Constant Prime No.",a, "\n"
    puts b
    print "\n"
    end
    end


    calc(a,m,p)


    Thanks is advance :)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default Re: Ruby to Java

    Start learning Java here: The Java™ Tutorials

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    pierovera is offline Member
    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Replies: 0
    Last Post: 03-26-2013, 05:56 PM
  2. Ruby or Java ????
    By devbose in forum Forum Lobby
    Replies: 1
    Last Post: 07-16-2012, 05:15 AM
  3. Replies: 0
    Last Post: 07-09-2012, 12:27 PM
  4. Ruby On Netbeans
    By makpandian in forum NetBeans
    Replies: 0
    Last Post: 06-05-2009, 12:35 PM
  5. ruby on rails
    By satti in forum Web Frameworks
    Replies: 1
    Last Post: 03-28-2009, 01:26 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •