code issue

package SuperThis;
public class Sub extends Super {
	/*public static void main(String[] args) {;;
    public void bar() {
    public void test() {;;
    	// Sub sub=new Sub();
    	 //   sub.test();

Open in new window

why above code is not working
i see error as below at line 21,15
Syntax error, insert "}" to complete ClassBody

Please advise
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Simple way to debug this type of problem.

Comment out all your code.

Then remove comments for each code section (method).

In your case, first glance, looks like this.test(); may be the problem.

Comment out this line + see if your error disappears.

I think you'll have to instantiate an object of SuperThis + then call the test method on your $object.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Owen RubinConsultantCommented:
So I guess some code is missing here, but if I compile this I get:

$javac SuperThis/

SuperThis/ error: illegal start of type
SuperThis/ error: ';' expected
SuperThis/ error: invalid method declaration; return type required
3 errors

So I am wondering if your compiler just throws that error because it does not know what to do with line 20?
You need to put

Open in new window

inside a method body.
Owen RubinConsultantCommented:
Damn, missed that myself. Good catch girionis.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.