Professional Documents
Culture Documents
3-2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Topics
3-3 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Java Classes
3-4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Program Structure
3-5 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Java Packages
3-6 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Using the Java Code Console
3-7 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Using the Java Code Console:
Creating a New Java Class
1. Click the New button to
create a new file.
2. Select the Java category
and Java Class file type.
3. Click Next.
3-8 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Using the Java Code Console:
Creating a New Java Class for an Exercise
4. Enter a class name and a package name.
5. Click Finish.
Run code
Show
Code Return to List of solution
editor Lessons
3-9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Exercise 3-1: Creating a Class
• Java classes
• The main method
Class name
main Program
method output
• Syntax:
System.out.println (<some string value>);
String literal
• Example:
System.out.println ("This is my message.");
Example