Difference between a java program and a java class

Hi there,
What is the difference between a java program and a java class?

HI,
A java class is an object - described in a .class file - which has been given properties and behaviours and which can be instantiated in a program.
A java program( application ) consists of at least one class (one of which must be declared public) and which executes its main() method ( of the public class ) when it is started.
Every program is a class but not every class is a program.
Examples:
A java program
// this simple program will print out the first command line argument you put
// in after calling : java ScreenWriter "arguments"
class ScreenWriter
public static void main( String [] args )
if( args.length > 0 )
System.out.println( args[0] );
A java class
//the Math class is already defined in the java.lang package
//and contains a constant for PI
//So I can include the Math class with the PI constant in my simple program
//and now I have a program that involves my ScreenWriter class and the Math class too.
class ScreenWriter
public static void main( String [] args )
if( args.length > 0 )
System.out.println( args[0] );
System.out.println( "The value of Pi is: " + Math.PI );
When you see package and import declarations at the start of a program they are there to ensure the compiler knows which classes are used in the program.
Hope that helps,
Terry

Similar Messages

  • I want to create an app.  Can you tell me the difference between iOS developer program and the mac developer program?

    I want to create an app.  Can you tell me the difference between iOS developer program and the mac developer program?
    Is the difference the device you're creating your app on, or for?

    iOS Developer Program is only for those who wish to develop iDevice apps. Mac program is for those only developing Mac applications. If you wish to do both, then you need to enroll in both programs.

  • Differences between Module Pool Programming and Reports and Scripts

    Hi,
    please tell me the Differences between Module Pool Programming , Reports and Scripts .
    Thanks nad Regards ,
    PavanKumar

    Hi
    Type 1 - is a report programming it can be executed by both transaction and program (F8). Hence its is also called as Executable program.You can start logical databases together with reports.
    Type M - Its a module pool program which is executed only by transaction code.
    Scripts - report with GUI interface. we can have graphics, watermark .
                SAPscript is a client dependent one.the Transaction for script is SE71.

  • Difference between Web Dynpro Abap and Web Dynpro Java

    Hi,
    What is the difference between Web Dynpro Abap and Web Dynpro Java.
    Thanks,
    Suresh

    hi suresh......
          from the end point of view, the customer wont know whether the application is done by java or abap. only the programming language differs and nothing much more.
    ---regards,
       alex b justin

  • How to interchange data between Java Program and C++ Program

    I constructed a java program using netbeans IDE that has ability to connect with a respective DLL; I want to connect and interchange data between my java program(.jar) and VSC++ program(.exe) through DLLs.JNI uses single Dll to invoke C/C++ function in native manner,In order to increase the efficiency I tried to connect and interchange primitive data types between Java program and C++ program using that DLL(JNI implemented).
    Unfortunately C++ program cannot obtain data values that has been changed by Java Program.For example - If I declare a global int variable in DLL,java program can catch that int variable and can update it but If I run my C++ program(exe) loading same DLL simultaneously it cannot receive the updated value of that int variable declared in the DLL.
    Therefore I need a solution to share/Interchange at least primitive data and their respective values between a JAVA and C++ Program using JNI (in spite of date transferring through Sockets).JAVA TO C/C++ & C/C++ to JAVA using DLLs.
    (TWO WAY COMMUNICATION)
    JAVA.jar  <=> <JNI> <=> DLL <=> [Connector Program C/C++] <=> C/C++ .exe
    PLEASE HELP ME!! THANK YOU

    What in the are you trying to say? What does "filled into the servlet mean?" Is the map somewhere outside the servlet? In a different process? Are you asking how to extract data from a map? Something else?
    Sorry, but your question makes no sense.

  • What is difference between data base structure and stucure  in program

    what is difference between data base structure and stucure  declared in program  level . can  explain cleary if knows

    Hi,
    Data base structure is global decalaration you can reffer this structure in any of your developments, when ever you cahange this structure the changes automatically will get updated in all the programs.
    coming to structures in program it is local to your program only, if you want to change the structure again you have to open the program and do the necessary changes.
    Reward if useful.
    Thanks,
    Sreeram.

  • Can ABAP program and a Java apps access the same DB table?

    If an ABAP program and a Java apps access the same DB table, how does the Enqueue services from ABAP and Java communicate with each other to ensure locking consistency (if they even communicate with each otehr at all)?
    Or there wont be such situation because there are separate schema for ABAP stack and Java stack?
    Your help is greatly appreciated.

    Hello!
    A while ago I was a subject to criticism too for not granting points to helpfull answers. I appeared to be ungratefull, but I'm actually not (I guess the same goes for Vincent). I absolutely agree that good people who provide helpfull answers deserve (at least) points, but I didn't quite get the whole idea with points untill I was explicitly warned. I took some time to correct this and I granted points for all my past questions, generously, with "interest rates" for waiting.
    My point is:
    The pointing system is good, but unintuitive and not documented. I suggested this at that time, and I see that nothing has changed since. I see also that I'm not the only one who has experienced missunderstandings.
    I repeat the message to SDN people: Please provide some info on pointing system! A few sentences behind a "What's this?" link would do. It's not such a hard work.
    Thanks!
    Kind regards,
    Igor Barbaric

  • Difference between Web Service Developer and Web Compononent Developer?

    What's the difference between Web services Developer and Web Component Developer? What's their job description. I'm aiming to be a web application developer. Which track should I follow?

    Here is another article on J2SE vs JEE:
    http://www.velocityrevies.com/forums/t151124-what-is-j2se-vs-j2ee.html
    I believe the people who said JSE is only for desktop development are not correct, as well as their saying their are 2 kinds of developer (web service and component).
    As I understand it, web service developers provide a way to expose the data and functionality of a program written in a particular language (such as Java or C#) as XML documents to anyone subscribing to the service over the internet. The remote applications subscribing to the service therefore can be written in any other language. For example, imagine a Cobol program trying to get data from a program written in Java. Since both cobol and Java should have ways to parse XML documents, they don't have to know each other's syntax. There are many programs written in many many languages in the web and XML is a standard way for them to communicate. Web Services are an advanced topic and you shouldn't worry about it until you master web applications and/or desktop applications.
    As I understand it, a web component developer creates java widgets that produce some visual image with basic functionality associated with it. For example, an html button. These widgets are used by other developers for the presentation layer when creating a web application or desktop application. I'm not sure about this definition since I never messed with web component development. I suggest you keep way from this specialized area on concentrate on web applications and/or desktop applications.
    You can consider application development as devided into two general categories. Web development and Desktop development (there are others). Web development is further broken down into browser based applications and mobile device applications. I suspect their are more jobs in web development than desktop development. I therefore suggest you concentrate on browder based web development (just my opinion). However, each has their advantages and disadvantages over each other, depending on the task at hand(http://stackoverflow.com/questions/905365/desktop-development-versus-web-development)
    Disclaimer:
    http://myweb.accessus.net/~090/univdisc.html

  • Difference between ISA 5.0 and ISA 7.0

    Dear ISA gurus,
      Can you please tell me what is the difference between ISA 5.0 and 7.0. Are there any changes in the ISA architechture. Is there any change in ISA Java API. Appreciate your pointers here.
    Thanks!
    Surya.

    Hi
    The ISA/ E-Commerce architecture remains the same , however we do have some functional enhancements.
    Enhancements in SAP CRM 2007
    1. The Web Catalog Management application has been replaced by the
    Catalog Management work centerthat is available with the WebChannel Manager role in SAP CRM
    The programming interface SAPTREX API replaces the SRET APIinterface that was used in SAP
    CRM 5.0
    2. New business process Sales Order Processing B2C for Service Providers in
    CRM Web Channel. This process covers:Selling of packages, rate plans,
    incentives, and enabling productsCollecting technical data Automatic contract creation for rate plan items
    prices)
    Management
    3.Dynamic field control for orders Search for items in orders,quotations, and order templates.
    4. Enhancements of the B2C Webshop UI: Catalog navigation, Webshop header, mini shopping basket,
    shopping basket, scale price display Verification word for integration with Interaction Center
    5. Additional way to display products in product catalog via block view
      Paging through list of (special and personalized) offers on Web shop home page
      Display of number of pages in catalog area browsing.
    Warm Regards,
    Sumit

  • Difference between, jre, jdk, sdk and j2se

    Dear Sir/Madam,
    I want to do some java and j2ee development and run these applications in a java application server environment. Can anyone give me some advices on what should i need to download? Moreover, what is the difference between, jre, jdk, sdk and j2se? Should i need to download all of jre, jdk, sdk and j2se?
    thanks and regards,
    david

    JRE is the 'java runtime environment'. It is responsible for creating a Java Virtual Machine to execute Java class files (e.g., run Java programs)
    JDK is the 'java development kit'. It is the same as the 'SDK' (at least in my mind). It normally comes bundled with a JRE and also allows you to compile Java source files into Java class files. The JDK allows you to both write and run programs.
    J2SE is "Java 2 Standard Edition". It can refer to either a JDK or JRE. This is 'core' Java. There is also J2EE "Java 2 Enterprise Edition" which allows you to write middleware or server code more easily.
    Your final choice will be which version. If you want the current, most common implementation:
    J2SE 1.4.2, J2EE 1.3
    If you want to skip ahead to the next generation, the latest releases would be:
    J2SE 1.5 (also called J2SE 5.0) and J2EE 1.4
    - Saish

  • ABAP+Java Kernel and only Java Kernel

    Hi Friends,
    Is there any difference in ABAP+Java Kernel and only Java Kernel?
    Can we use the kernel for above both from the same location as below?
    1#
    Support Packages and Patches> Additional Components> SAP Kernel> SAP KERNEL 64-BIT UNICODE> SAP KERNEL 6.40 64-BIT UNICODE
    Following Files
    DB Dependent  - ORACLE
              SAPEXEDB_175-20000227.SAR
              DBATL640O92_44-20000227.SAR
    Database Independent
              SAPEXE_175-20000226.SAR
    Assuming above SAR files contain R3trans, R3load, tp ,... also.
    2#
    As per my knowledge SAP has given one more path to download J2EE SP's which contains Kernel and J2EE Support Packages.
    http://service.sap.com/patches --> Support Package and Patches -> Entry by Application Group -> SAP NetWeaver -> SAP NetWeaver -> SAP NetWeaver 04 -> Entry by Component -> Application Server Java -> SAP J2EE Engine 6.40 -> J2EERT19_0-10001982.SAR/J2EERT20_0-10001982.SAR (OS Independent) and CTRLDB219_0-20000114.SAR(OS Dendependent)
    What is the difference between above two kernels?
    1# contains R3trans, R3load, tp ...etc which is exclusively used by ABAP Stack related functions. The startsap script used here would check R3trans -d authentication successful before starting database and then only it starts the database from sidadm. I observed OPS$ users available in only ABAP schema SAPSID but not available in SAPSIDDB. If I use the kernel downloaded from 1# for Java Stack only system, startsap would fail as R3trans authentication fail as there is no ABAP schema in Java systems.
    This applies well for ABAP+JAVA or only ABAP based systems.
    If I use only JAVA Stack based system can I use the kernel downloaded from 1# . What is the kernel and SP available in 2#? Is this also contains the same kernel given in 1# or it is different. I also observed in JAVA they are not calling Kernels by Patch No like 154, 175... they call it by SP19. Please correct me if I am wrong.
    Did anyone come accross this type if issue? I would appreciate if anyone can clarify my questions given above.
    My main target is to have clear strategy for ABAP+JAVA, ABAP, JAVA kernels to avoid mess up. Which one to download? What is best practice? Differences?
    Thanks and Regards
    Prasad

    Hi Sacha,
    Thank a lot for your answer I am clear now. Before rewarding points to you.
    I have final question.
    You mean that there is not seperate kernel for Java Stack Systems.. When we apply SP11 or SP19 by default it applies Kernel and also support packages w.r.t the SP. Do we have option to seperate Kernel and Support package while applying SP's for Java System?
    If we take for example SAP NW 2004 (WAS 640) latest kernel is 175 (I mean ABAP+JAVA). If I want to know the latest kernel for Java Stack system, Do I need to say it is at level SP19 or check the sapwebdisp -V (Resepctive patch level)?
    For ABAP system we check disp+work -V to get the source kernel version. How to justify the source kernel version for Java System?
    As per SAP Note: 710914 - Upgrading the J2EE Engine Startup Framework after applying SP for Java System, Do we need to upgrade J2EE Startup Framework?
    Thanks and Regards,
    Prasad

  • What is the difference between Component,Server,Tool and Software?

    HI,
    What is the difference between Component,Server,Tool and Software?
    SHABEER

    Hi
    Every individual part that constitutes in making an SAP System is called a COMPONENT.e.g DB instance, Java CI, ABAP CI etc
    SERVER is the actual composition of different components of SAP.e.g. a database alongwith can instance would constitue an application server.
    TOOLS are the products from different organisations (SAP or Non SAP) that can be used for different functionalities like keeping a check on jobs, monitoring of the system , e.g Tivoli
    SOFTWARES are a kind of tool that help you to bring up results from the system in a user acceptable format. These are utilities that act as interfaces between the user and the system.
    regards
    Chen

  • Difference between Abstract portal Component and JSPDyn page.

    Hi Experts,
    What is the difference between Abstract portal Component and JSPDyn page.
    Thanks,
    Jay.

    Hi,
    The PDK provides two methods for creating a portal component:
    Abstract Portal Component
    The Abstract Portal Component class offers a lean method for writing HTML commands to the Web client as well as for basic event handling. It is an implementation of the IPortalComponent, which is the central abstraction of the Portal Component API.
    DynPage
    The Page Processor Component, which extends the Abstract Portal Component, returns a DynPage. It provides more sophisticated event handling. Controls that produce events (such as buttons and checkboxes) have an event attribute that contains the name of the event handling method. This event handling method is invoked by the DynPage when it occurs.
    The JSPDynPage is an implementation of the DynPage and allows the use of the DynPage in combination with JSP (Java Server Pages).
    The PDK documentation and examples focus on the DynPage. Easier event handling and the separatation of content development (JSP) from application development (Java) make the DynPage a better choice for components with interaction and changing content.
    For more details, Refer thes thread,
    https://fortress.wa.gov/dop/portal/irj/portalapps/com.sap.portal.pdk.basic.portalcomponentimplementation/docs/jspdynpage.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0b3e9d5-b2af-2a10-20ba-9f6ce6b1a27f
    Hop it helps..
    GS
    Edited by: Sathishkumar GS on Apr 14, 2008 2:07 PM

  • Difference between Oracle Weblogic Administration and Ofm Soa Admin

    Hi,
    what is the difference between Oracle Weblogic Administration and Oracle Fusion Soa Weblogic server Administration?
    pls help me anyone, i want to learn weblogic Administration, but having some confusions..........
    thanks,

    The below is just for your reference. Actual content may vary....
    Weblogic Administration:
    Manage a WebLogic Server installation.
    To install weblogic server in one or multiple instances
    Installing on single or multiple physical machines
    How to handle administration console, utilities, APIs, hangling security, database connection, messaging and transaction.
    How to do runtime configuration for your applications.
    How to use the monitoring tools to check the health of the servers and ensure maximum availability and performance.
    Install and Configure WebCache 11g as Load Balancer
    and Much more..
    OFM SOA Administrator:
    Manage a WebLogic Server installation (Administration Server and Managed Server).
    To install weblogic server in one or multiple instances
    Installing on single or multiple physical machines
    How to handle administration console, utilities, APIs, hangling security, database connection, messaging and transaction.
    How to do runtime configuration for your applications.
    How to use the monitoring tools to check the health of the servers and ensure maximum availability and performance.
    and
    File System and Directory Structure in Fusion Middleware
    Installing Oracle Database, Configuring RCU, weblogic server and SOA Suite.
    Deploying SOA Applications.
    Deploying and Undeploying Java EE Applications
    Configuring Node Manager and starting Managed Servers using Node Manager
    Monitoring OFM Server, admin server, managed server and composites
    Configuring HA and Security (Creating users, assigning responsibilities)
    Monitoring performance of SOA composites
    Install and Configure WebCache 11g as Load Balancer
    and much more..
    Thanks,
    Vijay

  • Difference between 1.0.1 and 1.0.1_1

    What the difference between 1.0.1 and 1.0.1_1 webstart releases?
    Thx,
    Max

    From http://java.sun.com/products/javawebstart/docs/relnotes.html:
    Fixed bug 4465033: In the locales DE, IT, FR, SV, and JA, Java Web Start 1.0.1 will hang when attempting to display the security dialog for signed applications or applets. This bug has been fixed in Java Web Start 1.0.1_01.
    /Fredrik

Maybe you are looking for

  • Need help Restoring iPod to factory settings

    I have a new iPod 30G and somehow screwed things up trying to use Winamp to transfer files. I upgraded iTunes to 7 and when I start it up, it polls my iPod and I get this message: iTunes cannot read the contents of the iPod "IPOD". Go to the Summary

  • Urgent helep: socket write error

              Hi All,           My application is continuously writing the following error message to the domain           log of WLS eventhough app is running ok           javax.servlet.ServletException: Connection aborted by peer: socket write error   

  • Creating error bars on numbers 09

    I'm new to Numbers and I'm trying to draw error bars on my scatter graph. To draw the graph, I clicked on the chart button, chose scatter graph and just altered the info in a table that popped up to make my chart. To draw error bars, I went to the ch

  • Tiles+JSF exceptions

    Hi! When I try to insert a part of JSF into the tiles and when some of JSF tags method or property bindings throws an exceptions, this exception is being handled either by Tiles or by JSF and is rendered on page in place of tag - [ServletException...

  • Your system say my serial 2C*****0MD is not valid

    Your system say my serial 2C*****0MD is not valid, your software doesn't run, Quickwhatever and all I get is errors, I'm a computer engineer and even I can't follow all the fixes you/others say works. I can't even access from a USB, What's Up? <Edite