N
newbie_at_java
Hi All,
I am quite new to the java language. But I have a lot of experience with the Perl language.
I'm trying to make something really simple work.
There are two files. One (named Sub.java) contains one method that prints one line and one (named Super.java) that must use Sub.java.
Using Eclipse, I've put those two pieces of code in seperate files in one package (as you can see) in one project.
Eclipse tells me: "The method show_sub() is undefined for the type Super". Why type ? Only class Super exists, no type Super?
I cannot make this simple feat to work. Please tell me, in simple terms, why this does not work? What do I do wrong?
Code for Sub.java:
package tips;
import static java.lang.System.out;
class Sub
{
void show_sub()
{
out.println("Method: sub is called");
}
}
Code for Super.java:
package tips;
class Super
{
public static void main (String args[])
{
show_sub();
}
}
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
I am quite new to the java language. But I have a lot of experience with the Perl language.
I'm trying to make something really simple work.
There are two files. One (named Sub.java) contains one method that prints one line and one (named Super.java) that must use Sub.java.
Using Eclipse, I've put those two pieces of code in seperate files in one package (as you can see) in one project.
Eclipse tells me: "The method show_sub() is undefined for the type Super". Why type ? Only class Super exists, no type Super?
I cannot make this simple feat to work. Please tell me, in simple terms, why this does not work? What do I do wrong?
Code for Sub.java:
package tips;
import static java.lang.System.out;
class Sub
{
void show_sub()
{
out.println("Method: sub is called");
}
}
Code for Super.java:
package tips;
class Super
{
public static void main (String args[])
{
show_sub();
}
}
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-