Java package and c++ header files

What is the difference between importing java package and including header files in c++?

I do not know .. have been away from C/C++ for a long time...
As much as I remember you can only import one header file each time... also when you import a header file you can just call methods from the header file automatically ...
However I could be very wrong on this .. really lost touch from C/C++ ...
regards,
Sim085

Similar Messages

  • JAVA PACKAGES and JSP

    i Have two problems one is i am designing a website which consists of a form. I am trying to write the Connectiviy and all other insert statements in seperate java packages and include them in JSP files.
    i Have two java packages one is DBUtil(having two java files both dealing with connectovity) and another one is StudentUtIl which has java files that open the connections with database connection and insert data into DB., I am having a big Problem here. How can i call the function in the other java package in the files in this java package. i have openDB()and Close() in the other Db and i want to call these functions in JAVA classes in the other package. How to include a package. Both these packages are in the same File system mounted on a Local directory

    Thank you for the reply. I am giving the code i have given the full class name . and now it is giving the following error :
    Cannot reference a non-static method connectDB() in a static context.
    I am also giving the code. Please do help me on this. i am a beginner in java.
    import java.sql.*;
    import java.util.*;
    import DButil.*;
    public class StudentManager {
    /** Creates a new instance of StudentManager */
    public StudentManager() {
    Connection conn = null;
    Statement cs = null;
    public Vector getStudent(){
    try{
    dbutil.connectDB();
    String Query = "Select St_Record, St_L_Name, St_F_Name, St_Major, St_Email_Address, St_SSN, Date, St_Company, St_Designation";
    cs = conn.createStatement();
    java.sql.ResultSet rs = cs.executeQuery(Query);
    Vector Studentvector = new Vector();
    while(rs.next()){
    Studentinfo Student = new Studentinfo();
    Student.setSt_Record(rs.getInt("St_Record"));
    Student.setSt_L_Name(rs.getString("St_L_Name"));
    Student.setSt_F_Name(rs.getString("St_F_Name"));
    Student.setSt_Major(rs.getString("St_Major"));
    Student.setSt_Email_Address(rs.getString("St_Email_Address"));
    Student.setSt_Company(rs.getString("St_Company"));
    Student.setSt_Designation(rs.getString("St_Designation"));
    Student.setDate(rs.getInt("Date"));
    Studentvector.add(Student);
    if( cs != null)
    cs.close();
    if( conn != null && !conn.isClosed())
    conn.close();
    return Studentvector;
    }catch(Exception ignore){
    return null;
    }finally {
    dbutil.closeDB();
    import java.sql.*;
    import java.util.*;
    public class dbutil {
    /** Creates a new instance of dbutil */
    public dbutil() {
    Connection conn;
    public void connectDB(){
    conn = ConnectionManager.getConnection();
    public void closeDB(){
    try{
    if(conn != null && !conn.isClosed())
    conn.close();
    }catch(Exception excep){
    The main error is occuring at the following lines connectDB() and closeDB() in the class student manager. The class dbutil is in an another package.with an another file called connectionManager which establishes the connection with DB. The dbutil has the openconnection and close connection methods. I have not yet written the insert statements in StudentManager. PLease do Help me

  • How to create a package and add a file?

    Hi all,
    I am new to Java and very much much confussed with how to create a package and then include some files any help will be very thankfull.
    Thanks for your help
    kka.

    Steps for creating a package in java are as follows:
    Choose a base directory for your classes. For example, you might choose c:\java\packages. Type the following command:
    set CLASSPATH=%CLASSPATH%;c:\java\packages
    Create subdirectories for each chapter or section, if you don't already have them.
    For each of the classes in the subdirectories, add the following line to the very top of each file:
    package directory-name;
    where directory-name is the name of the subdirectory the class file is located in.
    In other directories you may have class files that need to access one of the classes in another directory (package). To do this, write one of the following at the top of the class that needs the other class:
    import subdir.*;
    or
    import subdir.classname;
    Use the class by name in the new class file.
    Note that you can create sub-packages by creating subdirectories of the original subdirectories, and inserting package statements at the top of the java files in those directories.
    Hope this helps!

  • To know abt java packages and classes

    please give an idea abt how to find the list of packages and classes
    available in the java packages

    Which ones? If you mean the ones available in the standard Java APIs, check the java-docs:
    1.4.2:
    http://java.sun.com/j2se/1.4.2/docs/api/
    1.5:
    http://java.sun.com/j2se/1.5.0/docs/api/

  • Java packages and dependency

    When java was being developed, what was the philosophy behind allowing packages to be mutually dependent?

    Hello Steve,
    The Acyclic Dependencies Principle tells us that no cycles should exit in a model depicting the dependencies between packages. From what I can gather this is useful when developing large software systems, as each package becomes a viable work unit for an engineer or small group of engineers to control as a series of releases. If the ADP is not complied with, cycles may exist in the dependencies between packages. If a change is made to one of those packages within a cycle, then an ugly situation develops as the repercussions of the change are looped through the cycle back to its source and so on.
    The thing is though, during my readings I came across a statement that said Java packages were mutually dependent. I was just wanting to know why a language that utilises object oriented technology, left the practice of the ADP up to the descretion of the developer? Is the full implementation of ADP on a software system an ideal world scenario?
    Anders.

  • Error when Packaging and PDF'ing File

    I am curently involved in creating a comprehensive brand book (60 pages) for our company in InDesign CS4 and seem to have a problem when I PDF or go to package the InDesign file. The message I get is:
    "Error encountered while reading JPEG image. Image may be damaged or incompatible. Resave the image with different settings and try again."
    Funny thing is when I close InDesign and re-open the file, then go to PDF it works fine. But then after I have worked on it and go to re-PDF it starts Ok but gets to about page 18 and the error pops up. I get the same error when I go to package the file even in the package summary - could not figure out what was wrong. I tried deleting all images off that page then re-PDF and still does not work.
    What's worse is that InDesign does not provide detailed information regarding the image or error, I had to look where the bar stopped while I was in the process of PDF to figure out what page the image is on.
    Can anyone shed some light on this?
    Thanks

    Here is an earlier thread discussing this problem:
    http://www.adobeforums.com/webx?128@@.59b7927d
    There's some unrelated stuff in the middle, but relevant information at both ends.
    Peter

  • Java Packages and Imports

    Hi,
    I have 2 java classes
    A.java
    B.java
    ### A.java ###
    import B;
    public class A
    public static void main(String[] args)
    public class B
    public void foo()
    when I compile B , it works fine, but when i compile A.
    it gives following error
    '.' expected
    why java doesn't allow to create & import a class without package, is there any workaround to resolve this issue
    this is a sample code i have posted, but actually I am facing the same problem in my current project. even if i include that class in classpath error doesn't go away.
    Please suggest what can be done to resolve this issue.
    Thanks in advance.
    NP

    - the default package (the package with no name)It does? Not for me.Gosh, you're right, it doesn't. Sorry.
    Actually, I never use it, my post was a copy/past from damned tutorial...
    - Tim - Harakiri - aaarrhhggg...

  • Java Applet and Perl - writing files

    OK. i need to be able to write a file to a folder on the webpage that the applet is on so that i can access these files for later use. i also understand that u need to use a server to do this. fortunately my web hostingsupports Perl but i don't know the first thing about it.
    i need someone to help me understand how to create a perl server so that the applet can write files.
    Can anyone show me either a thorough tutorial or explain it step by step as i do not know much about servers or servlets.

    I assume you are putting up an applet that can have a user search through his hard drive folders for a particular file, then want the file sent to a servlet on the server? If so, read up on the html tag <input type="file"
    and find some examples on how to use it. I dont know enough about applets to tell you how to do it with an applet.

  • Packaging and Collecting Multiple files

    Hi,
    Does anyone know of a quick way to collect multiple files for artwork.
    I have 60 individual fact sheets that I need to send to print, doing each individually will drive me mental!
    Ta
    Jim

    Hi, sorry, I'm a bit technology-illiterate, and I replied to this post because it looked the most relevant to what I was hoping to accomplish.
    I don't have InDesign, so I guess I'm in the wrong forum, but any help ANYONE can provide would be appreciated.
    I do apologize for not posting in the right place, but frankly the help page for Adobe Reader 9 (which is what I have) had absolutely no answers to my question.
    Basically, the task at hand is to create a coherent, single PDF file, if possible, from 33 images that I have. These images are copies of pages from a primary source document found via the Library of Congress. When I hit the "save image" button on the website, that is the format that they downloaded in.
    My OS is Windows Vista. I know that I have, at some point in time, managed to jury-rig a PDF from multiple files before, but I can't remember how on earth I did it the first time because I came about it by accident.
    I'll understand if it's impossible to make a PDF out of the files the way that they're currently formated, and I do appreciate your timely response.
    Thanks so much for trying to help, and please let me know if you can think of anything I can do (without paying to download a program - I'm way too poor for that)

  • How to link a java program and a music file played

    i wanna know how do i read values of music (mp3 or any other format) that are played ? for example if if there is a sound like "pimm" ,there should be a value(hex,dec etc) for it that is used by the player to play it.

    There are commercial products that allow you to do this (e.g. InstallAnywhere from http://www.zerog.com).
    One issue is that you have to decide whether you want to bundle a JRE with your program or not. If you do (and you should, in these days of XP shipping without any VM of its own), your program will be a minimum of about 9MB + whatever you actually add as part of your program :-).
    In any case, this is not a trivial undertaking.

  • Xmlstarlet and header files confusion

    I'm trying to make a package out of xmlstarlet. Just running configure and then make has me running into this error:
    ad /usr/lib/libxml2.a -lz -lm -lpthread -ldl -L/usr/lib
    /usr/lib/libexslt.a(crypto.o): In function `exsltCryptoGcryptInit':
    crypto.c:(.text+0x15c): undefined reference to `gcry_check_version'
    /usr/lib/libexslt.a(crypto.o): In function `exsltCryptoRc4DecryptFunction':
    crypto.c:(.text+0x2d4): undefined reference to `gcry_cipher_open'
    crypto.c:(.text+0x2fe): undefined reference to `gcry_cipher_ctl'
    crypto.c:(.text+0x327): undefined reference to `gcry_cipher_decrypt'
    crypto.c:(.text+0x333): undefined reference to `gcry_strerror'
    crypto.c:(.text+0x36f): undefined reference to `gcry_cipher_close'
    crypto.c:(.text+0x47c): undefined reference to `gcry_strerror'
    crypto.c:(.text+0x4bc): undefined reference to `gcry_strerror'
    /usr/lib/libexslt.a(crypto.o): In function `exsltCryptoRc4EncryptFunction':
    crypto.c:(.text+0x60f): undefined reference to `gcry_cipher_open'
    crypto.c:(.text+0x639): undefined reference to `gcry_cipher_ctl'
    crypto.c:(.text+0x668): undefined reference to `gcry_cipher_encrypt'
    crypto.c:(.text+0x674): undefined reference to `gcry_strerror'
    crypto.c:(.text+0x6b0): undefined reference to `gcry_cipher_close'
    crypto.c:(.text+0x814): undefined reference to `gcry_strerror'
    crypto.c:(.text+0x854): undefined reference to `gcry_strerror'
    /usr/lib/libexslt.a(crypto.o): In function `exsltCryptoSha1Function':
    crypto.c:(.text+0x90c): undefined reference to `gcry_md_hash_buffer'
    /usr/lib/libexslt.a(crypto.o): In function `exsltCryptoMd5Function':
    crypto.c:(.text+0xa0c): undefined reference to `gcry_md_hash_buffer'
    /usr/lib/libexslt.a(crypto.o): In function `exsltCryptoMd4Function':
    crypto.c:(.text+0xb0c): undefined reference to `gcry_md_hash_buffer'
    collect2: ld returned 1 exit status
    make[2]: *** [xml] Error 1
    make[2]: Leaving directory `/tmp/xmlstarlet-1.0.1/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/tmp/xmlstarlet-1.0.1'
    make: *** [all-recursive-am] Error 2
    Now, I don't know how to interpret that error, but the Soureforge page does contain the following advice which I figured might be pertinent:
    Make sure that libxml2 and libxslt header files matches (by version) with libraries you are linking. The versions of include files can be found in ${include_prefix}/libxml2/libxml/xmlversion.h and ${include_prefix}/libxslt/xsltconfig.h
    Using find I came up with the files
    /usr/include/libxslt/xsltconfig.h
    /usr/include/libxml2/libxml/xmlversion.h
    and digging into them made it clear that libxml was version 2.6.32 and libxslt was 1.1.24. But I don't knwo how to match that? Or if this is even remotely relevant to the error message, I'm seeing?

    chochem wrote:bugger... I just submitted it but I can't find any way to submit my .install file alongside it - any hints?
    Just include it in your package and resubmit it (the new package will replace the old one). Also, MIT is not a standard license so you need to store a copy of it in /usr/share/licenses/<package name>/ (read the wiki for more information on this).

  • What package contains /usr/include header files?

    (Sorry for the x-post; put it in the wrong place originally.)
    I'm trying to find out which package contains the header files located in /usr/include/. I'm trying to compile some stuff and these headers aren't found. Any ideas? This is Solaris 10 x86 8/07.

    Alan, thanks for the reply -- I've sorted it out.
    I was looking for the "standard" headers in /usr/include/ such as stdio.h, sys/stat.h, to name a few. Found them in the SUNWhea package.

  • Remove packages and all the config files associated with it

    How can I remove a package and all the files folders hidden folders config files and examples which are installed with it.
    In short how can I revert the system back to the state when the package was not even there.
    When i remove a package i still see some folders which are associated with it in some weird directories.
    Is there a way to get rid of those.
    Thanks

    From the pacman man page:
    Remove Options
    -c, --cascade
        Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive, and must be used with care since it can remove many potentially needed packages.
    -k, --keep
        Removes the database entry only. Leaves all files in place.
    -n, --nosave
        Instructs pacman to ignore file backup designations. Normally, when a file is removed from the system the database is checked to see if the file should be renamed with a ".pacsave" extension.
    -s, --recursive
        Remove each target specified including all of their dependencies, provided that (A) they are not required by other packages; and (B) they were not explicitly installed by the user. This operation is recursive and analogous to a backwards --sync operation, and helps keep a clean system without orphans.
    -n seems to be what you are looking for.

  • Using Cpp code and header files with LV8 CIN

    Hello,
    I have three pieces of C++ code and their header files that are called from a Main C++ code.  I want to call these from a LV8, code interface node (CIN).  I have the C++ compiler installed on teh same machine as LV8.  My questions are:
    1) How do I call the C++ code anf the header files from the LV CIN?  I have never doen this. Is there a concise manul for this somewhere?  Teh last thing any self-respecting engineer wants to do is read the manual.
    2)  Once I successfully call teh C++ and header files from within the CIN, can I create a LV runtime executable, just as I can with any other LV8 .vi?  Will this runtime .exe run stand-alone as a distribuatble application?  Do I need to include any special runtime files when I build the exectuable to support teh C++ code?
    Thank you.

    http://forums.ni.com/ni/board/message?board.id=231&message.id=2424&requireLogin=False
    handles your question.

  • How to include and call exe file in jar?

    Hi, I am writing a Java application that calls an external exe file to accomplish some tasks. In order to make the program more user friendly, I would like to package the Java application and the exe file into one JAR file and distribute that JAR file to users. I tried to package all these files by running the following command:
    jar cmf manifest.txt java_class_file exe_fileThe manifest.txt contains only the following entry:
    Main-Class: java_class_fileHowever, when I execute the program with java -jar bundle.jar, the JVM complains that it cannot find the exe file. (Everything works fine when I run the original class file with java)
    Would anyone kindly teach me how to do this?
    Thanks in advance!

    You cannot call an exe file in a jar.
    You can have the jar unpack the exe and then run it however.

Maybe you are looking for

  • Recovery question

    I need to recover some files from gds, but i can't find the table containng the database references to files in the GDS. Since they have human unreadble names (i.e. sdf3543dfbg...) it would be helpfull to know where is stored that information in the

  • FBZ5 -Payment Advice print without giving check details

    Hi all, I got one requirement regarding FBZ5 I want to print only Payment Advice through FBZ5 without specifying check details (like check lot no). Currently check lot no is mandatory field. So how to skip check details ? For Payment Advice i am havi

  • Left Click event lost in IE7 - Portal v6

    We had a few users accept the IE7 install by mistake, which caused issues.  The left click event is not being recognized in the left menu panel when attempting to run a report.  The user can right click and "open in new window" to run the report. Has

  • I want to have a section where I have a list of parts, qty, description, price and extension.

    I am building a form, in one section I want to list several things with prices, I want to be able to total those items automatically

  • MDT Database Credentials promt

    Hi, all! I;m trying to deploy OS in SCCM 2012. I stucked with credentials promt for mdt database on MDT rule processing step. Does anybody know how to disable it? I've added UserID, UserPassword and UserDomain into CustomSetting.ini in mdt settings p