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 2 of 2

Thread: how to import my own class in my .java file

  1. #1
    Member
    Join Date
    Nov 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default how to import my own class in my .java file

    hello,

    how to import my own class in my .java file

    i want to import this class to another separate file, how should i call it. is it
    import javafiles.Amrclass;
    or what?

     
    public class Amrclass {
     
        public static int Amr(int x, int y) 
        {
        	return (x+y);
     
        }
    Last edited by amr; December 17th, 2010 at 08:48 PM.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: how to import my own class in my .java file

    The following tutorial might be of help:
    Creating and Using Packages

Similar Threads

  1. calling a java a class connected to derby from a batch file
    By Reem in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 31st, 2010, 03:01 PM
  2. [SOLVED] Iterator next import class?
    By daydreamer in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 3rd, 2010, 04:51 AM
  3. how to import excel file to database table using java
    By palani in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: September 3rd, 2010, 12:17 AM
  4. Basic Java File I/O with Scanner Class Problem
    By miss confused in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 26th, 2010, 08:04 AM
  5. run java class file from independent of OS
    By starsoheil in forum Java Theory & Questions
    Replies: 6
    Last Post: March 16th, 2010, 08:05 AM