473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error in code: <identifier>expected

Expand|Select|Wrap|Line Numbers
  1. public class HelloWorldBean implements HelloWorld 
  2. {
  3.     public void sayHello(String name); 
  4.             System.out.println("Hello, World");
  5. }
This is the code i want to execute but it is showing an error like <identifier>expected..
Dec 20 '12 #1
2 2833
Rabbit
12,516 Expert Mod 8TB
You need to specify where the function begins and ends with curly brackets.
Expand|Select|Wrap|Line Numbers
  1. public class HelloWorldBean implements HelloWorld  
  2.     public void sayHello(String name)
  3.    { 
  4.             System.out.println("Hello, World");
  5.     }
Dec 20 '12 #2
Hi! you have to start and close the curly brackets from where your function starts and you put a semicolon after function which is not allowed.
Expand|Select|Wrap|Line Numbers
  1.     public class HelloWorldBean implements HelloWorld  
  2.     { 
  3.         public void sayHello(String name)
  4.        { 
  5.                 System.out.println("Hello, World");
  6.         }
  7.     }
Dec 21 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike Fisher | last post by:
I'm seeing an error when I try to run/debug a web service. Although it doesn't happen every time, it does occur more than half of the times I hit F5. It appears to be returned by the the JIT...
1
by: timVerizon | last post by:
Hoping someone can help here.. Our application (C#.Net) was receiving IBM.Data.DB2.DB2Exceptions ERROR SQL0904N Unsuccessful execution caused by an unavailable resource. Reason code: '', type...
3
by: Antoine | last post by:
Hello, I'm writing a program to send requests to my wlan pocket pc device (UIO1: driver) in C#. Here how I import CreateFile functions from coredll.dll with DllImport: public static extern...
5
by: frazer | last post by:
hi i want to get the error code when an error occurs. is catch(Exception ex) { ex.GetHashCode() //will this return a unique number for every error? }
1
by: Razzie | last post by:
Hi all, I was working on a little project, worked fine, but now all of a sudden I get: The compiler failed with error code -1073741502 as an error message (when running the site, not...
2
by: Roger Wang | last post by:
HELP!!!! We have got a W2k server running IIS5 with .NET framework 1.1 and .NET framework SP1. All ASP.NET applications cannot run on this box. It all returned with the same error: ...
2
by: mike_li | last post by:
On Window 2000 Professional Server DB2 UDB Level: DB2 code release "SQL07029" with level identifie "030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and "WR21337". In the...
1
by: delusion7 | last post by:
Trying to create a table and insert records from a webform and I keep getting this message: "Successfully created the registration table. Unable to execute the query. Error code...
4
by: Pool | last post by:
I tried to connect DB2 (Sitting in Unix server at my client location) using Db2 connect V8. I am getting the following error message. I tried all the possible options BUt the error is same.. See each...
2
by: sareena | last post by:
There is a problem with accessing an ASP appln hosted on a dedicated Win '03 load balanced server running IIS 6.0 in worker process isolation mode. When the user types in the URl of the appln and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.