How to integrate two codes  ?

A.java
class A
     public static void main(String args[])
System.out.println("hello");
     // code
Format.java
import java.util.*;
class Format
public static void main(String args[])
System.out.println("hi");
// code
how to integrate two codes ?

Please be a little more explicit about what you're doing, what you expect to happen, and what you actually observe - "integrate two codes" isn't very clear.
Please post a short, concise, executable example of what you're trying to do. This does not have to be the actual code you are using. Write a small example that demonstrates your intent, and only that. Wrap the code in a class and give it a main method that runs it - if we can just copy and paste the code into a text file, compile it and run it without any changes, then we can be sure that we haven't made incorrect assumptions about how you are using it.
Post your code between [code] and [/code] tags as described in Formatting Help on the message entry page. Cut and paste the code, rather than re-typing it (re-typing often introduces subtle errors that make your problem difficult to troubleshoot). Please preview your post when posting code.
If you don't know where to start, here are some excellent resources:
http://java.sun.com/docs/books/tutorial/
http://java.sun.com/developer/onlineTraining/Programming/BasicJava1/compile.html
http://java.sun.com/learning/new2java/index.html
http://javaalmanac.com
http://www.jguru.com
http://www.javaranch.com
Bruce Eckel's Thinking in Java
Joshua Bloch's Effective Java
Bert Bates and Kathy Sierra's Head First Java

Similar Messages

  • How to integrate two plantfloor systems

    Can anybody help me that how to Integrate two plant floor systems

    Hi Rajkumar
    Please specify which plantfloor systems. Every plant floor system has their own interface or using the standard interface such as Webservice etc.
    So in future I would suggest you be specific in order for us the forum folk to answer your question correctly.

  • How do the two codes work ?

    i came across the following code in socket programming in the net,could anyone please tell me that how do the following codes work together? there is no main class in ChatHandler programme but there seems that it is a separate programme.. being new to java i am unable to understand it, please someone help
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class ChatServer {
        public static final int DEFAULT_PORT = 9800;
        public static void main(String[] args) {
         int port = DEFAULT_PORT;
         ServerSocket serverSocket = null;
         Socket socket = null;
         try {
             if(args.length > 0)
                 port = Integer.parseInt(args[0]);
         } catch(NumberFormatException nfe) {
             System.err.println("Usage: java ChatServer [port]");
             System.err.println("Where options include:");
             System.err.println("\tport the port on which to listen.");
             System.exit(0);
         try {
             serverSocket = new ServerSocket(port);
             while(true) {
                 socket = serverSocket.accept();
                 ChatHandler handler = new ChatHandler(socket);
                 handler.start();
         } catch(IOException ioe) {
             ioe.printStackTrace();
         } finally {
             try {
                 serverSocket.close();
             } catch(IOException ioe) {
              ioe.printStackTrace();
    }// ChatHandler.java
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.Socket;
    import java.util.Vector;
    public class ChatHandler extends Thread {
      static Vector handlers = new Vector( 10 );
      private Socket socket;
      private BufferedReader in;
      private PrintWriter out;
        public ChatHandler(Socket socket) throws IOException {
            this.socket = socket;
         in = new BufferedReader(
             new InputStreamReader(socket.getInputStream()));
         out = new PrintWriter(
             new OutputStreamWriter(socket.getOutputStream()));
        public void run() {
            String line;
         synchronized(handlers) {
             handlers.addElement(this);
    // add() not found in Vector class
         try {
             while(!(line = in.readLine()).equalsIgnoreCase("/quit")) {
              for(int i = 0; i < handlers.size(); i++) {     
                   synchronized(handlers) {
                          ChatHandler handler =
                           (ChatHandler)handlers.elementAt(i);
                      handler.out.println(line + "\r");
                   handler.out.flush();
         } catch(IOException ioe) {
             ioe.printStackTrace();
         } finally {
             try {
              in.close();
              out.close();
              socket.close();
             } catch(IOException ioe) {
             } finally {
              synchronized(handlers) {
                  handlers.removeElement(this);
    }

    pranay09 wrote:
    ok, but when i am compiling the two codes, then for the second one i get the error that no main class found:No, you will never get that when compiling.You will get that when running, if the class you try to run is not on your classpath.
    main() is simply the entry point into your program for the JVM. When you say
    java MyClassYou're telling hte JVM to execute public static void main(String[] args) in the class MyClass. That class must be on your classpath and it must have that method. That class is then free to use any other classes, in its own package or in other packages (provided they are accessible and on the classpath), regardless of whether those classes have a main method.

  • How to integrate two applications in wda.

    Hi experts ,
    I have two applications in WDA .
    I would like to integrate these two applications in the third one.
    And wants to run third application so that i can see first and second applications view. How can I achieve it.
    Thanks .

    You can easily embedded one Web Dynpro component within another.  This is exactly what you are doing when you use ALV.  You can do the same thing with your components.  I suggest that you start be reading the help section on cross component usage:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/a7/1d8b412bb5b35fe10000000a1550b0/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/a7/1d8b412bb5b35fe10000000a1550b0/frameset.htm]
    At the risk of a little self promotion, the topic of component reuse and embedding is a central topic of the Web Dynpro ABAP sections of the SAP Press Book - Next Generation ABAP Development.

  • How to integrate two VIs (diffserv,​intserv)

    hi
     i need help in the to make  integration of two vi (DiffServ,IntServ) attached with this  email  as my topic is integration of differentiated services and Integrated services ..
    how i can integrates these two VIs
    thanks
    Attachments:
    Diffserv.vi ‏58 KB
    IntServ.vi ‏63 KB

    Thread duplcated
    Doug M
    Applications Engineer
    National Instruments
    For those unfamiliar with NBC's The Office, my icon is NOT a picture of me

  • How to integrate two .llb?

    Hi all,
    I have 2 libraries that I need to integrate together. Any idea how i can integrate them? Both .llb contains different .vi
    Regards,
    Aiya

    Hello aiya,
    I mean using the VI library manager you can copy/move/rename/delete vi's from one library to another.
    You don't have to create a new llb to do this.
    Best regards,
    GerdW
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to integrate two Siebel Applications into single app UI

    Dear All,
    Currently we have a Siebel application which is running with various Siebel modules. Like for example in one single application object manager we are having various screens and views related to various modules like UCM, Loyalty, Marketing etc.
    But due to some operational reasons, we would like to deploy few modules as applications on different machines.For example we will install a separate Marketing application on a server and loyalty on a separate server.
    How can we integrate all these applications installed in different different machines in a single App Object Manager to provide a single UI interface for the user.
    So even after segregating into different applications, we would like to have single app UI for user.
    Please suggest if it already being implemented in such a way anywhere.
    Regards

    Hello...
    Siebel offers many great options to help you implement your business needs. siebel bookshelf is very well documented...we can also connect you with a few great system integrators that could help you architect your siebel implementation? best wishes for this holiday season...
    Regards,
    Sylvia Fong Ny- GERMAIN SOFTWARE - Performance Monitoring Software for Siebel CRM
    21 Columbus Avenue, Suite 221, San Francisco, CA 94111, USA
    [email protected], http://www.germainsoftware.com

  • How to integrate two controller​s of different vendors to synchronis​e the motion

    We have intended to synchronise the motion of X-Y linear positioning stages with the motion of precision press actuator. These machines supplied by different vendors and came with their stand alone controllers and their platform software controls. However, each controller has digital I/O which can be used to extraxt the digital signal for external devices. I am looking advice for the simple way to integrate these controllers and to develop synchronising motion of these machines...appreciate your comment thank you

    It would be helpful to know more about the driver stages you use. Do they have their own feedback loop, i.e. do they use rotary or linear encoders and have their own position control? If so, is it possible to route the encoder drivers to the NI controllers?

  • How to integrate two picture?

    Hi
    am trying to put picture above picture but i can't
    any idea?

    Use graphic editor.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "cavalry82" <[email protected]> wrote in
    message
    news:gi5g2v$cf5$[email protected]..
    > Hi
    >
    > am trying to put picture above picture but i can't
    >
    > any idea?

  • How to integrate existing value into one in hierarchy char.

    I have a char. hierarchy call ZCOMP_CODE. ZLEADER is compounding with ZCOUNTRY.
    The master data in ZCOMP_CODE looks like
    ZLEADER;ZCOMP_CODE;
    010;1000;
    010;1001;
    010;1002;
    020;1000;
    021;1000;
    In query  I have char. ZCOMP_CODE in row and one KF ZREVENUE in column. Previously we calculated ZLEADER 010,020,021 separately. But, now I want to calculated ZLEADER 020 and 021 together. Does anyone know how to integrate two existing value into one and display it in query? Do I need to create a new hierarchy node for including 020,021?
    Thanks!
    rajatina.

    don't know how you can achieve this in the query...
    but in the workbench there's a solution. Just add a routine in the transformation to change 021 to 020.
    if you need to have still the 021 info somewhere, create a ZCOMPANY_CODE2 where you store only the values needed (010, 020)... use this company code as hierarchy in the report, and use the other company code for displaying the 021...
    hope it's clear,
    M.

  • How to use Bar code field in Item master

    Hi Experts
    I want to know that How to integrate Bar code scanner data with SBO. Bar code contain many information like price, serial no., description etc . For example I want that when I read a barcode by barcode scanner it automatically update itemcode, description , price and serial no.
    Thanks
    regards
    Gorge

    Hello Gorge,
    A barcode would ideally contain only an identification code and not other information. All such information like price, etc. should be fetched from a database, after reading the barcode, and identifying the item.
    You can simply enter the barcode in the Item Master Data and than use the barcode field to identify the item in sales / purchase documents instead of itemcode or itemname.
    Rahul

  • How to integrate RFSG driver with sampling theorem labview code

    hi all, 
    I got the labview code of sampling theorem from labview-> find examples. How can I integrate this code with PXI system? How can I integrate the RFSG driver with labview code?

    Hi Nieman,
    LabVIEW 2014 should be compatible with the 9068 and the cRIO 2.1 drivers.  I verified it should work as expected earlier today.  Please make sure you are using the example cRIO PN-IO Device when you are moving the module over to the new target.  If you are already accessing that, please navigate to this folder:
    <Program Files>\National Instruments\LabVIEW 2014\Targets\NI\FPGA\cRIO\other
    Please let me know if you see a CS_cRIO-PNAD folder. This folder provides all the files necessary to discover and use the module in the project.  If we do not have that folder there, we will be unable to locate the module.  If that is indeed the case, then it may be the driver did not install correctly.  
    If after finding this folder and it is still not working, please send me screenshots of the error that you are seeing and a MAX Technical Report.  Thanks!
    Matt S.
    Industrial Communications Product Support Engineer
    National Instruments

  • How to use two split this method in my code

    How to use two split this method in my code
    if i got one string line which like this
    ("aa!bb!cc~ab!bc!cd") a
    nd want to use two split to spare ! and ~ this seal for my spare point how that output
    has come diff ?
    public static void main(String[] args) {
        String str = "aa!bb!cc~ab!bc!cd";
        String strs[]= str.split("~");
        String strE[]= str.split("!");
        int count =0;
        for(int j=0; j < strs.length; j++){
          for (int i = 0; i < strE.length; i++){   
              System.out.println(count + " " + strE);
    count++;
    the output how can it be like this
    0 aa
    0 bb
    0 cc
    1 ab
    1 bc
    1 cd

    Move your second slit inside the first loop, so you are splitting the substring, not the entire string.

  • IS Test stand support Code written in VC++ ?..IF SO How to integrate with Test Stand

    IS Test stand support Code written in VC++ ?..IF SO How to integrate with Test Stand

    If you have LabWIndows-CVI, you may also look at these threads: (may be useful for TestStand)
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000003C1F0000&UCATEGORY_0=_318_&UCATEGORY_S=0

  • How to integrate java + OpenCv. Please help me!!!

    Hi all.
    I am researching OpenCV and how to integrate OpenCV with java.
    If you have any experience with this problem please help me.
    OpenCV + Java . Can i control PTZ of logitech Usb webcam ?
    Thanks in advance.
    Diego
    Edited by: ThuCT on Jun 30, 2009 9:34 PM

    A recursive function is simply a function that calls itself sometimes. You have to be careful, because if it always calls itself, you have an "infinite regression" where it never stops calling itself and you get stack overflow. I don't know what recursion has to do with traversing result sets, but I can give you a simple example of a recursive function (statements can't be recursive):
    public class ArithmeticFunctions
         static int GreatestDivisor(int i, int j)
              if (j = 0) return i
                   else return GreatestDivisor(j, i%j); // this is the recursive part
         }This code will use Euclid's algorithm to quickly find the greatest common divisor of two numbers, i.e. GCD(27, 9) = 9; GCD(9, 6) = 3; GCD(25, 15) = 5
    Doug

Maybe you are looking for

  • Data Loss when a database crashes

    Hi Experts, I was asked the question of "how much data is lost when you pull the plug off an oracle database all of a sudden".. and my answer was "all the data in the buffers that have not been committed". We know that you can have committed data sit

  • How to get tv shows and movies backed up on external sata drive?

    I realised a couple of days ago that several of my movies and tv shows that I purchased are no longer downloaded on my computer but are stored on the cloud. Now how do I get a backup on my drobo external disk? I don't want to fall or be without wifi

  • TS3297 I find the instructions to use automatic date/time in ts3297 to be totally unacceptable.

    I do things on my MBP (software builds) that REQUIRE consistent timestamps. I also travel extensively, which frequently results in "going backwards in time' (flying east to west). Updating date/time automatically causes total confusion for my builds,

  • Can't download Adobe Fash Player

    I seem to have lost the Adobe Flash Player that was in my computer.  I am now having difficulty trying to redownload it.  What am I doing wrong? I need help

  • Lightroom and CR2 Files

    I have just downloaded lightroom and it cannot read my CR2 files downloaded from iPad. Any ideas to solve problem appreciated