• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAva help  RSS feed

 
benz spida
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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");
}
}
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • 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.
  •  
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!