473,466 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

It says <identifeier> expected for the public void greet (HelloWorld)

1 New Member
Expand|Select|Wrap|Line Numbers
  1. public class HelloWorld
  2. {
  3.     private String greeting= "Hello World!";
  4.  
  5.     public void greet (HelloWorld)//you create a String variable
  6.  
  7.     {
  8.         System.out.println("My name is Gabi Watson");//This is what was passed to the method. You should also add your greeting here. 
  9.  
  10.     }
  11.     public static void main(String args[])
  12.     {
  13.         HelloGabi greetMe= new HelloGabi () ;
  14.         greetMe.greet("I attend High School");
  15.     }
  16. }
Sep 30 '15 #1
1 1331
chaarmann
785 Recognized Expert Contributor
Hello Gabi Watson,
the error message says, that a method parameter must be declared with type (=identifier) and name, but you only give name (="HelloWorld") here.
So change "public void greet (HelloWorld)" to "public void greet (String helloWorld)"
Sep 30 '15 #2

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

Similar topics

4
by: Shailendra Batham | last post by:
Hi guys,Does any1 know what this error is all about, what I am trying to do is deserialize a XML, below is my code, let me know what I am doing wrongpublic class test{xin = "<?xml version='1.0'...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
2
by: snowie | last post by:
I have a simillar problem to what others have had before me. I just can't find the solution in any earlier post here at the scripts (or any other forum). I am calling a web service that returns a...
9
by: Jack | last post by:
I get the following errors from the code ( CRM 3.0 ) below, whats wrong ? Any suggestions are welcome because i'm kinda stuck here. The first error is pointing on the last bracket ] <--- ...
5
by: xirowei | last post by:
i'm newbie in java servlet, how to let public void doPost can access to public void doGet, stringLength variable? below is my code: import javax.servlet.*; import javax.servlet.http.*; import...
2
by: camzgon121 | last post by:
Hi guys, I have this code and when I try to compile and run it gives me an <identifier> expected error. The code with the irrelevant parts taken out. package ACCOUNT; import...
2
by: bugmenot2 | last post by:
Hi, i have a problem with my program not compiling. It says "(" Expected on line 31, when there is in fact a bracket there. Thanks in advance. import java.awt.*; import javax.swing.*;
2
by: Gnapika | last post by:
public class HelloWorldBean implements HelloWorld { public void sayHello(String name); System.out.println("Hello, World"); } This is the code i want to execute but it is showing an error...
2
by: rahuldhawan123 | last post by:
#include<iostream.h> #include<conio.h> class figure { public: virtual void Area(); }; class square:public A { public:
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.