Thread: [REP/VERY SIMPLE/BASIC JAVA] Question.

Results 1 to 8 of 8
  1. #1 [REP/VERY SIMPLE/BASIC JAVA] Question. 
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    YES im new to coding.

    What is "package" and "importing?

    [CODE]package net.com.codeusa.net;

    import java.util.Hashtable;
    import java.util.Map;[CODE]

    package is the name of the file if u want to import it into another file? importing is the "import (location here)" bit? what does importing do? whats it's use?
    Reply With Quote  
     

  2. #2  
    Registered Member
    X Mercy X's Avatar
    Join Date
    May 2009
    Age
    31
    Posts
    1,336
    Thanks given
    3
    Thanks received
    41
    Rep Power
    301
    package - the folder/package** the class is in
    importing leads to the package and then the class allowing you to use public methods within that class

    Reply With Quote  
     

  3. #3  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Quote Originally Posted by xmercyx View Post
    package - the folder/package** the class is in
    importing leads to the package and then the class allowing you to use public methods within that class
    I'm that nooby. What do you mean by class? and public statis stuff inside code files whats all that. I said rep for a reason

    EDIT: thanks for replying right away.
    Reply With Quote  
     

  4. #4  
    Member [REP/VERY SIMPLE/BASIC JAVA] Question. Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    package is a reference to the source folder the class file is located.
    import 'links' other class files to the class files so they can be used.

    Instead of importing you could always do :-
    com.src.folder.ClassFile.method(); lol.

    A class is a .JAVA file, and a .class file once compiled, it's the file/s with the code in.

    EDIT2 : static is a modifier which makes that piece of code accessable from all classes of the same type without change, perhaps you should give this a read :-

    http://java.sun.com/docs/books/tutorial/index.html

    Then download a source, mess around with it, change some stuff and voila .

    Attached imageAttached image
    Reply With Quote  
     

  5. #5  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Quote Originally Posted by Luke132 View Post
    package is a reference to the source folder the class file is located.
    import 'links' other class files to the class files so they can be used.

    Instead of importing you could always do :-
    com.src.folder.ClassFile.method(); lol.

    A class is a .JAVA file, and a .class file once compiled, it's the file/s with the code in.
    Got the first bit kinda =|

    What do you mean by
    Quote Originally Posted by Luke132 View Post
    Instead of importing you could always do :-
    com.src.folder.ClassFile.method(); lol.
    And when you build/compile, well in codeusa/Z525 you only build "Engine.java" and in there is loads of imports, so does it work like, it makes Engine.java (compiles it) into a .class, and then compiles the imports, and THOSE imports have more and more imports that Engine.java didnt have, so it's like a long chain till it has nothing more to compile?
    Reply With Quote  
     

  6. #6  
    Member [REP/VERY SIMPLE/BASIC JAVA] Question. Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    You don't need to bother with the second bit i said (about importing).

    And at your other question, yes exactly that .

    Attached imageAttached image
    Reply With Quote  
     

  7. #7  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Quote Originally Posted by Luke132 View Post
    You don't need to bother with the second bit i said (about importing).

    And at your other question, yes exactly that .
    Thanks dude! ! REP'd

    Oh and @ the first dude who posted, sorry but "you must spread around more reputation before giving to this user again"
    Reply With Quote  
     

  8. #8  
    Registered Member
    X Mercy X's Avatar
    Join Date
    May 2009
    Age
    31
    Posts
    1,336
    Thanks given
    3
    Thanks received
    41
    Rep Power
    301
    lol its k idc about rep really i was new once, few helped so i always help when i see fit

    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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