• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java code compiling correctly in JCreator giving run time error in online compiler

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator






hey guys i am frustrated..
please see this link :http://ideone.com/zuID1
i wrote the same program in c++ but it was giving a runtime error due to some non standard memory allocations..so even though im a javba noob ..i managed to write the same thing in java..the code might not be clean at all..as i said, i am still fooling around with access specifiers and i font have a clue on how im supposed to run this thing....the program works correctly in jcreator..please this links my earlier attempt..help..
https://coderanch.com/t/594816/CPP/code-not-compiling-online-compiler
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. KeepItDown(⇐click).

2. It's not clear what your problem is. You need to TellTheDetails(⇐click).
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your program compiles and actually works fine, for me. Not sure what you mean by "runtime error in online compiler"; can you explain a bit more what problems you're having?
 
sinatra roger
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for being a troll...

its working in the online compiler fine now..

okay now i have a cool head ill explain what happened..

there is an online compiler for java :

www.ideone.com

you guys should check it out..

I was having trouble comipling and running this code as I was expecting to give inputs in the normal way..during run time like it happens when you use a normal compiler(offline)..but what i missed was that in online compilers, you have to give inputs before you run the program. i figured it out now and got it.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

thejwal pavithran wrote:
you guys should check it out..



Why?

And for that matter, why are you using it?

(I'm honestly curious. I cannot imagine any reason why I'd want to check it out, nor any benefit it might have for me. And since you already have a compiler installed locally, I can't imagine why you're bothering with an online compiler either. But then, I don't have a very good imagination, so maybe I'm missing something.)
 
sinatra roger
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Verdegan wrote:

thejwal pavithran wrote:
you guys should check it out..



Why?

And for that matter, why are you using it?

(I'm honestly curious. I cannot imagine any reason why I'd want to check it out, nor any benefit it might have for me. And since you already have a compiler installed locally, I can't imagine why you're bothering with an online compiler either. But then, I don't have a very good imagination, so maybe I'm missing something.)



its a very valid doubt..
actually this code is gonna be evaluated by somebody and that somebody uses this online compiler to evaluate the code..actually i coded this problem in c++ and it was working fine in my compiler..but it was giving a hell lot of errors due to the non standard memory allocation functions I was using..once i solved those issues, the compiler gave me run time segmentation error(yeah i am damn good at pointers!!).

So i managed to write this thing in java with the little knowledge I had...no wonder they say java is easy..

java was too good for the compiler and it had to give up and compiled successfully..

i think its good enough to glance through because if you dont have the time to install a jdk on a new system when you dont have your pc with you, this is a good tool for writing java programs..but it has its own limitations
 
reply
    Bookmark Topic Watch Topic
  • New Topic