- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: java code structures/heirarchy..
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2002 02:10 AM
02-21-2002 02:10 AM
java code structures/heirarchy..
1> .class
/home/java/MyJava.class
2> .jar
jar -tvf MyJar.jar
x x x x MyJava.class
3> .jar (package?)
jar -tvf MyPackage.jar
x x x x com/hp/api/MyJava.class
Thanks!
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2002 04:39 AM
02-21-2002 04:39 AM
Re: java code structures/heirarchy..
CLASS's:
A class--the basic building block of an object-oriented language such as Java--is a template that describes the data and behavior associated with instances of that class. When you instantiate a class you create an object that looks and feels like other instances of the same class. The data associated with a class or object is stored in variables; the behavior associated with a class or object is implemented with methods. Methods are similar to the functions or procedures in procedural languages such as C.
http://java.sun.com/docs/books/tutorial/getStarted/application/classdef.html
JAR's:
JAR files are packaged with the ZIP file format, so you can use them for "ZIP-like" tasks such as lossless data compression, archiving, decompression, and archive unpacking. These are among the most common uses of JAR files, and you can realize many JAR file benefits using only these basic features.
http://java.sun.com/docs/books/tutorial/jar/basics/
PACKAGE's:
(1) Applets Packaged in JAR Files (for browser execution)
(2) Applications Packaged in JAR Files
http://java.sun.com/docs/books/tutorial/jar/basics/run.html
I know you wanted sysadmin speak, but I haven't finished my first cup of "java" yet ;-)
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2002 05:36 AM
02-21-2002 05:36 AM
Re: java code structures/heirarchy..
2 and 3 is a bit vague.
A class can be put in a jar,
but not in a package..
it's all that com/hp/api/thing
that I don't really understand..!
Thanks for the links anyway..
I really hate reading docs though!.. or even mans... that's what I mean by sysadmin lingo ....
Is there such a thing as mini man pages!!!
Great idea huh?!
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2002 05:47 AM
02-21-2002 05:47 AM
Re: java code structures/heirarchy..
A package is a jar file, and class's are usually included as part of a package.
Applications Packaged in JAR Files - 1.1 platform
You can run applications that are bundled as JAR files by using the JDKTM 1.1 jre tool:
jre -cp app.jar MainClass
In version 1.1 of the JDK software, the -cp option prepends the app.jar file to the system classpath. MainClass identifies the class within the JAR file that is the application's entry point. (Recall that in an application, one of the classes must have a method with the signature public static void main(String[] args) that serves as entry or starting point for the application.)
JAR Files as Applications - 1.2 platform only
In version 1.2 of the JDK software, you can run JAR-packaged applications with the Java interpreter. The basic command is:
java -jar jar-file
The -jar flag tells the interpreter that the application is packaged in the JAR file format.
http://java.sun.com/docs/books/tutorial/jar/basics/run.html
I know it's weird...
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2002 01:12 AM
02-22-2002 01:12 AM
Re: java code structures/heirarchy..
We're clear that a jar file is analogous to a tar file. It's like a compressed archive of one or more class files.
A Package is slightly different. The classes in a package are logically related. For example, the package com.xyz.devices.printers will contain a bunch of classes that are related to printers. While com.xyz.devices.monitors will contain classes related to monitors.
Java has a well-defined security implementation, wherein the attributes (variables) and methods (functions) can be exposed to other classes or hidden from them.
1. A 'public' attribute is accessible to the whole world.
2. A 'private' attribute is internal to the class, and cannot be accessed by any other class.
3. A 'protected' attribute can be accessed by sub-classes ("children" of the class) only, not by alien classes.
4. All other attributes can be accessed by OTHER CLASSES IN THE PACKAGE, but not by classes that are not part of the package.
See the code snippet below:
package com.abc.dummies
class Parent // Parent class
{
public Parent () {}; // Class constructor
int no_modifier = 10; // Available to the whole package
private int priv = 20; // Data internal to this class
protected int prot = 30; // For use by sub-classes as well
public int pub = 40; // For use by anyone
}
The attribute Parent.no_modifier is only visible to other classes that are part of the com.abc.dummies package. This is, to my mind, the single most important reason why packages are used.
Hope this helps.
