Solved

Problem to the codes

Posted on 2015-02-10
19
98 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:Bing CISM / CISSP
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:Bing CISM / CISSP
Bing CISM / CISSP 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 74
Core Java. What output will be and why ? 6 64
eclipse java  build path 6 43
eclipse shortcuts 9 45
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

947 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now