Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: java commands

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default java commands

    Hi Everyone,

    Is there any command to find all the classes inside a package? If so let me know...
    eg: To find all the properties and methods inside a class String we use "javap java.lang.String"

    Thanks and Regards,
    Sunil


  2. #2
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: java commands

    Well to import all the classes of a library you would use,
    for example:

    import.java.util.*;

    Once you have the import, you can view all the methods by just
    choosing one with the '.' operator after the util class.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  3. The Following User Says Thank You to Ada Lovelace For This Useful Post:

    sunilhs (August 21st, 2014)

  4. #3
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: java commands

    Initially I would like to thanks for your answer. As you said, if i import any package in IDE it will show me suggestions as soon as i use '.' operator. But my problem is if I am using a text editor to write a program and want to compile and run it in a command prompt then how can I know the classes which comes under "util" package. Is there any command like "javap"?

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: java commands

    One way would be to open the src.zip file that comes with the JDK and look in the folder for the package you are interested in.
    If you don't understand my answer, don't ignore it, ask a question.

  6. The Following User Says Thank You to Norm For This Useful Post:

    sunilhs (August 21st, 2014)

  7. #5
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: java commands

    Do you have access to the API? For example, the java.util api: java.util (Java Platform SE 7 )
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  8. The Following User Says Thank You to aussiemcgr For This Useful Post:

    Norm (August 21st, 2014)

  9. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: java commands

    Of course. The packages are listed In the upper left corner of the page for the API doc at:
    Java Platform SE 7
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Making Commands in Java
    By Camwarp in forum Java Theory & Questions
    Replies: 1
    Last Post: November 29th, 2013, 11:30 PM
  2. How to Make Java Commands
    By Camwarp in forum Java Theory & Questions
    Replies: 4
    Last Post: November 27th, 2013, 09:05 AM
  3. Execute Linux commands through java program.
    By ars42025 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 25th, 2013, 03:39 AM
  4. Sending commands through Java to Terminal
    By CountryGamer in forum What's Wrong With My Code?
    Replies: 7
    Last Post: May 9th, 2013, 02:31 AM
  5. Executing Linux Commands with Java GUI
    By linuxrockers in forum AWT / Java Swing
    Replies: 2
    Last Post: February 15th, 2010, 10:57 PM