Solved

Problem to the codes

Posted on 2015-02-10
19
112 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
[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
  • 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 125 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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 10

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 10

Assisted Solution

by:Jeffrey Dake
Jeffrey Dake earned 375 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 10

Assisted Solution

by:Jeffrey Dake
Jeffrey Dake earned 375 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 10

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 10

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 10

Accepted Solution

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

Author Comment

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

Expert Comment

by:Jeffrey Dake
ID: 40602411
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

623 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