1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Cocoa - Obj C and Java?

Discussion in 'Mac Programming' started by jeremy.king, Sep 24, 2004.

  1. macrumors 603


    Can you intermix languages when writing a Cocoa application? I would love to leverage some of my java skills, as well as some Open Source APIs, AND use Obj-C...I know when you start a project, it asks what language you are going to use. Has anyone done this? Is it possible?
  2. macrumors G3



    When you start a project, it's really asking what language will be at the core. The above documents how to pull in Java, and there really isn't anything special about using ordinary C functions in ObC, just go ahead and #include and call 'em from inside your ObjC methods.
  3. macrumors 603


    Thanks Meow.

    I just can wait til I get my two books (hopefully today), so I can get started on writing Apps for OS X.
  4. macrumors 68000


    While you can't use Java and Obj-C together, you can use Obj-C and C and C++ together (known as Objective-C++). You give your implementation files a .mm extension, and so long as you use right Obj-C vs. C++ syntax for the right objects, you'll have no problems.

Share This Page