Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem to the codes

Posted on 2015-02-10
19
Medium Priority
?
122 Views
Last Modified: 2015-02-10
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.
0
Comment
Question by:HuaMinChen
  • 10
  • 7
  • 2
19 Comments
 
LVL 37

Expert Comment

by:bbao
ID: 40602287
what's the exact error message you got?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602298
I only get the attached. It does not show with more details.
t974.png
0
 
LVL 37

Assisted Solution

by:bbao
bbao earned 375 total points
ID: 40602326
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602339
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
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602340
Please disregard my current reply.
0
 
LVL 11

Expert Comment

by:Jeffrey Dake
ID: 40602342
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
 
LVL 11

Assisted Solution

by:Jeffrey Dake
Jeffrey Dake earned 1125 total points
ID: 40602343
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
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602346
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
 
LVL 11

Assisted Solution

by:Jeffrey Dake
Jeffrey Dake earned 1125 total points
ID: 40602349
try
{
   int value = Integer.pareseInt("23");
}
catch(NumberFormatException nfe){}

This will set value = to whatever your string value is.
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602356
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
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602357
To 3rd line in above.
0
 
LVL 11

Expert Comment

by:Jeffrey Dake
ID: 40602374
Oops typo. It is parseInt. There was an extra e in there
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602386
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
 
LVL 11

Expert Comment

by:Jeffrey Dake
ID: 40602390
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
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602394
Any other example to show one message?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602395
Or prompt one input?
0
 
LVL 11

Accepted Solution

by:
Jeffrey Dake earned 1125 total points
ID: 40602400
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40602408
Many thanks.
How to prompt one input?
0
 
LVL 11

Expert Comment

by:Jeffrey Dake
ID: 40602411
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

971 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