Hello,
I am relatively new to
Java, may be the question that I am asking is very simple but please help me out with this.
I created a folder under the bin directory named "MyPack" here i am putting my Sample Java files.
Now I created a file under this named variousareas.java and the file contains:
package MyPack;
public class variousareas
{
int radius;
int height;
int width;
int area;
public void circlearea(int radius)
{
area=(int)3.14*radius*radius;
System.out.println("area of the circle is"+area);
}
public void rectangle(int width,int height)
{
area=width*height;
System.out.println("area of the circle is "+area);
}
}
then I created one more file areamain.java and the file contains:
package MyPack;
public class areamain
{
public static void main(
String []args)
{
variousareas v1=new variousareas();
v1.circlearea(2);
v1.rectangle(2,3);
System.out.println("Keep searching, this search is on, on and on");
}
}
then I compiled variousareas.java and it got compiled successfully, now when I am trying to compile areamain.java I am getting the error:
C:\Program Files\Java\jdk1.7.0_02\bin\source files\MyPack\areamain.java:8: error
: cannot find symbol
variousareas v1=new variousareas();
^
symbol: class variousareas
location: class areamain
2 errors
Can anyone please point out my mistake....