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
Solved

Problem to the codes

Posted on 2015-02-10
19
104 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 10

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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
LVL 10

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 10

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 10

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 10

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 10

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 10

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 10

Author Comment

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

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 10

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

839 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