• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAva help

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can any one help I am trying to create a JAVA comments useing the same statement three times to demonstrate each of the three methods of commenting in java

this is what i have done so far


//Demonstrating comments
// Written by <>
// Written on <>

public class Hello
{
/*Program comments are nonexecuting statements your
add to a program for the purpose of documentation */

System.out.print1n("Hello");//Program comments are nonexecuting statements your
// add to a program for the purpose of documentation
/**Program comments are nonexecuting statements your
add to a program for the purpose of documentation. */
{
public static void main(string[] args)
{
system.out.print1n("Hello,world");
}
}
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

If you're experimenting with comment lines, you might want to start with code that works on its own. That way, you will know whether the comments you are trying to add are causing problems. There are several reasons that this code will not compile, but none of these have to do with the comments.

Some things to consider:
  • Java is case-sensitive. For example, "system" is not the same as "System."
  • The "println" method name is all letters (no numerals).
  • For every opening brace, you should have a closing brace.
  • Method calls should generally be placed inside the bodies of other methods.
  •  
    You can thank my dental hygienist for my untimely aliveness. So tiny:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic