Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Java Pointers and Missing method body

  1. Jul 1, 2004 #1
    I declare my pointer as char* ptr and my function as public boolean FuncFoo() but java compiler complains that I have some problem with identifier right at * and my function is missing the method body...
    I couldn't figure out what was wrong with them. Would you please help me ?
    Thank you,
  2. jcsd
  3. Jul 1, 2004 #2
    Firts part: Java doesn't have pointers.

    Second part
    Code (Text):

    public boolean FuncFoo()
              you need a body even if you leave it bank
    Java doesn't require function definitions either (is that why you're not using the {}?). Simply create your function and call it.

    http://leepoint.net/notes-java/10background/10applications_and_applets/05intro/60JavaVsC.html [Broken]
    Last edited by a moderator: May 1, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook