Presentation is loading. Please wait.

Presentation is loading. Please wait.

Debugging Exercise 00 Try compiling the code samples.

Similar presentations


Presentation on theme: "Debugging Exercise 00 Try compiling the code samples."— Presentation transcript:

1 Debugging Exercise 00 Try compiling the code samples.
Examine the errors reported by the compiler. Try to figure out what’s really wrong.

2 public class Hello ( public static void main( String args[] ) System.out.println( “Hello world” ); )

3 public class Hello { public static void main( String args[] ) System.out.println( “Hello world” ;) }

4 public class Hello { public static void( String args[] ) System.out.println( “Hello world” ); }

5 public class Hello { public static void main( string args[] ) System.out.println( “Hello world” ); }

6 public class Hello { public static void main( String args[] ) System.out.printIn( “Hello world” ); }

7 public class Hello { public static void main( String args[] ) system.out.println( “Hello world” ); }

8 C:\> java Hello.java

9 C:\> javac Hello

10 import javax.swing.* import java.awt.*; public class HelloAgain extends JApplet { public void paint( Graphics g ) g.drawString( “Hello”, 50, 50 ); }

11 import javax.swing.*; public class HelloAgain extends JApplet { public void paint( Graphics g ) g.drawString( “Hello”, 50, 50 ); }

12 import javax.swing.*; import java.awt.*; public class HelloAgain extends JApplet { public void paint( Graphics g ) g.DrawString( “Hello”, 50, 50 ); }

13 import javax.swing.*; import java.awt.*; public class HelloAgain { public void paint( Graphics g ) g.drawString( “Hello”, 50, 50 ); }

14 C:\> javac HA.html


Download ppt "Debugging Exercise 00 Try compiling the code samples."

Similar presentations


Ads by Google