Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

User Defined Package Doubts

Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 "".
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic