Download presentation
Presentation is loading. Please wait.
Published byBeata Cybulska Modified over 5 years ago
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.