File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes User Defined Package Doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "User Defined Package Doubts" Watch "User Defined Package Doubts" New topic

User Defined Package Doubts

Viji be

Joined: Aug 16, 2004
Posts: 23
Hello All

Iam trying to create a user defined package MyPack
Iam encountering a problem :

MyOperation m=new MyOperation(); --- Cannot resolve symbol..
plz go thru the codes and tell me how to solve the errors...

package MyPack;

public class MyOperation
public int add(int a, int b)
int c;
return c;
public int sub(int d,int e)
int f;
return f;
public int mul(int g,int h)
int i;
return i;
public int div(int j,int k)
int l;
return l;

import MyPack.*;

public class MyCalculation
public static void main(String args[])
int n1,n2,n3,n4;
MyOperation m=new MyOperation( );
System.out.println("The Value of n1 is"+n1);
System.out.println("The Value of n2 is"+n2);
System.out.println("The Value of n3 is"+n3);
System.out.println("The Value of n4 is"+n4);

I have compiled ""...problems is in "".

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i trie this:

before, i created two folders inside my root(raiz, in my case), called MyMain (this one will contain MyCalculation) and MyPack
to MyCalculation i made:

java amateur
I agree. Here's the link:
subject: User Defined Package Doubts