473,406 Members | 2,633 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,406 software developers and data experts.

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

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 1328
chaarmann
785 Expert 512MB
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: 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...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.