?
Solved

Java Packages

Posted on 2003-03-26
5
Medium Priority
?
212 Views
Last Modified: 2010-03-31
So I have a folder called "Sandra" and in that folder I have three .java files.
All begin with package sandra; and one of them wants to use some of the stuff in another, so I say import sandra.other;
However this is generating a compile error saying that it can't resolve the symbol, pointing to the name of the class I am trying to import.
Have I just configured my ide incorrectly? I am just using Textpad since the work I am doing is supposedly really simple...
0
Comment
Question by:Redbirdofthesouth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 8215334
1. you do not need to import classes in the same package.

2. the parent folder of sandra should be included in your classpath
0
 

Expert Comment

by:evimal
ID: 8215398
Hi

 for ex,
  one.java,two.java,three.java all belongs to same package called "package sundar;".

 If u want to call a function in "two" from "Three", then try to declare that all these classes are public. and u can call without any import command.


the code should be lie this

package sundar;

public class one{}
----------
package sundar;

public class two
{
static void print()
{
  system.out.println("Works fine");
}
}
-----------
package sundar;

public class three{

p.s.v.m (String s[])
{
   two.print();
}
}

----------------
0
 
LVL 92

Expert Comment

by:objects
ID: 8215410
:-)
0
 

Author Comment

by:Redbirdofthesouth
ID: 8215576
I barely scraped through my file io class.
I have downloaded Marty Hall's ProtectedPage files from Core Servlets and JSP, and am attempting to run them.
I've added the appropriate files to my web.xml file.
I am getting a null pointer exception from Tomcat:
java.lang.NullPointerException
     at java.io.File.(File.java:180)
     at java.io.FileInputStream.(FileInputStream.java:66)
I did make the file output point to an appropriate location on MY computer.
It seems to me that I would need to run the  password builder file first but when I did I just get a thread exception...
0
 
LVL 92

Expert Comment

by:objects
ID: 8215697
looks like u are passing a null filname.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question