Solved

Problem to the codes

Posted on 2015-02-10
19
96 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars2 challenge 6 70
disable Win7 network security 2 77
mapShare challenge 13 69
Non-recursive backtracking, using a stack 1 52
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…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
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:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

746 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

12 Experts available now in Live!

Get 1:1 Help Now