This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java code compiling correctly in JCreator giving run time error in online compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java code compiling correctly in JCreator giving run time error in online compiler" Watch "Java code compiling correctly in JCreator giving run time error in online compiler" New topic
Author

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

thejwal pavithran
Ranch Hand

Joined: Feb 11, 2012
Posts: 117






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..
http://www.coderanch.com/t/594816/CPP/code-not-compiling-online-compiler


on job hunt
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

1. KeepItDown(⇐click).

2. It's not clear what your problem is. You need to TellTheDetails(⇐click).
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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?


[Jess in Action][AskingGoodQuestions]
thejwal pavithran
Ranch Hand

Joined: Feb 11, 2012
Posts: 117
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

Joined: Jan 03, 2004
Posts: 6109
    
    6

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.)
thejwal pavithran
Ranch Hand

Joined: Feb 11, 2012
Posts: 117
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java code compiling correctly in JCreator giving run time error in online compiler
 
Similar Threads
Reading input from console to 2D array with Scanner Class
can't resolve method println
pattern Match without using Pattren or RegulaExpression
Compare two text
Problem.