Results 1 to 3 of 3
  1. #1
    itaipee is offline Member
    Join Date
    Dec 2008
    Posts
    99
    Rep Power
    0

    Default have "regular" functions - with no class

    Hi

    I want to have funciton , which does not related to any class - get string return int - or whatever - the point that I need to use it in several classses and java scripts .

    how should I ddo it ? Do I have to create special class for that?

  2. #2
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    283
    Rep Power
    7

    Default

    In java I dont think you can think of any thing without a class. Now as far as using it anywhere is concerned , not sure about java script, but if the methods are public and the class in which the methods have been declared is public, it can be called from any other class.

  3. #3
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    Default

    Building a little more on what dswastik states, place it in a class... hhhmmm ... maybe call it "Library" and build it up with more more useful methods, like, Openfile, ReadFile, RountToTwoDecimals, etc. That way you can access your favorite/custom methods from one source.

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Similar Threads

  1. Java, Military Format using "/" and "%" Operator!!
    By sk8rsam77 in forum New To Java
    Replies: 11
    Last Post: 02-26-2010, 04:03 AM
  2. Replies: 2
    Last Post: 01-24-2009, 07:56 PM
  3. Replies: 0
    Last Post: 11-22-2008, 02:49 AM
  4. Replies: 1
    Last Post: 10-20-2008, 08:35 AM
  5. Replies: 1
    Last Post: 03-14-2008, 03:51 PM

Posting Permissions

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