Problem to the codes

Hi,
I don't know what the problem is

package com.hkicl.ecp.hkanvm.b1;

public class BankAcctNoValidator_1 {
	public int ValAcctNo (String BankCode,
			String BankAcctNo)
	{
		
	}
}

Open in new window


as I try to build the project, having the above codes, within Eclipse Java project. When building it, it does show errors.
LVL 11
HuaMin ChenProblem resolverAsked:
Who is Participating?
 
Jeffrey Dake Senior Director of TechnologyCommented:
0
 
bbaoIT ConsultantCommented:
what's the exact error message you got?
0
 
HuaMin ChenProblem resolverAuthor Commented:
I only get the attached. It does not show with more details.
t974.png
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bbaoIT ConsultantCommented:
what will happen if you move the cursor ON the small red cross or just simply CLICK the whole line after the error icon?
0
 
HuaMin ChenProblem resolverAuthor Commented:
Thanks a lot.
I've added few lines to that and when I put cursor to that, I get the attached. what to adjust?
t975.png
0
 
HuaMin ChenProblem resolverAuthor Commented:
Please disregard my current reply.
0
 
Jeffrey Dake Senior Director of TechnologyCommented:
You should try compiling to make sure it is showing you the correct lines. Also in the lower panel where you are on the console tab, if you switch to the problems tab it will tell you all the compile errors you have. This is easier than hovering over the particular line.
0
 
Jeffrey Dake Senior Director of TechnologyCommented:
Also you error was from using = instead of .equals. The = in Java will assign the variable. To compare strings you want to use the equals function.
0
 
HuaMin ChenProblem resolverAuthor Commented:
BTW, I want to check if it is possible to convert one string to number, and also to detect the error, if it is not possible. how?
0
 
Jeffrey Dake Senior Director of TechnologyCommented:
try
{
   int value = Integer.pareseInt("23");
}
catch(NumberFormatException nfe){}

This will set value = to whatever your string value is.
0
 
HuaMin ChenProblem resolverAuthor Commented:
Many thanks Jeffrey.
I put these
			try
			{
			   int value = Integer.pareseInt(str2);
			}
			catch(NumberFormatException nfe){}
...

Open in new window

but I get the attached.
t976.png
0
 
HuaMin ChenProblem resolverAuthor Commented:
To 3rd line in above.
0
 
Jeffrey Dake Senior Director of TechnologyCommented:
Oops typo. It is parseInt. There was an extra e in there
0
 
HuaMin ChenProblem resolverAuthor Commented:
Many thanks.
One last issue, how to resolve the attached, due to these few lines?

			JOptionPane.showMessageDialog(frame,
				    "Bank Code should be '049'.",
				    "Inane warning",
				    JOptionPane.WARNING_MESSAGE);
...

Open in new window

t977.png
t978.png
0
 
Jeffrey Dake Senior Director of TechnologyCommented:
It is complaining that both variables were not declared. Whatever example you got this from probably has some more code creating the frame variable to be passed in.
0
 
HuaMin ChenProblem resolverAuthor Commented:
Any other example to show one message?
0
 
HuaMin ChenProblem resolverAuthor Commented:
Or prompt one input?
0
 
HuaMin ChenProblem resolverAuthor Commented:
Many thanks.
How to prompt one input?
0
 
Jeffrey Dake Senior Director of TechnologyCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.