Você está na página 1de 5

Java Codelab Solutions: Section 2.

1 Java Application Structure

Java Codelab Solutions


Wednesday, September 18, 2013

Blog Archive

2014
(1)

Section 2.1 Java Application Structure

2013
(132)

October
(21)

September
(105)

60106: Which of the


following is NOT a legal identifier? 7thheaven

Section 10.3 The


protected Access
Modifier

60108: Which of the


following IS a legal identifier? ______________

Section 10.2.4 Overriding


Inherited Methods

60098: Which of the


following names in a program is equivalent to the name int? None
of the above

60118: An identifier
that cannot be used as a variable name is a reserved word.

Section 10.2.3 Adding


Specialization to the
Subcla...

60120: Which of the


following is NOT a Java reserved word? main

Section 10.2.2 Subclass


Constructors

60094: A comment
starts with what characters? //
The text of a comment can
be anything the programmer wants to
write.

Section 10.2.1 Inherited


Members of a Class
Section 10.1 Inheritance

85016: Of the
following variable names, which is the best one for keeping track of whether a
patient has a fever or not?
hasFever Of the following variable names, which is the
best one for keeping track of whether an integer might be prime or
not? mightBePrime

Section 9.7.4 Using the


ArrayList Class in a
Progr...

20503: Write a
statement that prints Hello, world to the screen:

Section 9.7.2 Methods of


the ArrayList Class

System.out.println( "Hello,
world" );

20504: Write a
complete main method that prints Hello, world to the screen:

public static void main( String []


args )

System.out.println( "Hello, world"


);

System.exit( 0 );

20505: Suppose
your name was Alan Turing. Write a statement that would print your
last name, followed by a comma,
followed by a space and your first name:

System.out.println( "Turing,
Alan" );

20506: Suppose
your name was George Gershwin. Write a complete main method that
would print your last name,
followed by a comma, followed by a space and
your first name:

public static void main( String []


args )

System.out.println( "Gershwin,
George" );

System.exit( 0 );

Section 9.7.1 Declaring


and Instantiating
ArrayLis...
Section 9.3.1 Processing
All the Elements of a
Two...
Section 6.14 Exercises,
Problems, and Projects
Section 6.11 Nested
Loops
Section 6.10 CountControlled Loops Using
for
Section 6.8 EventControlled Loops Using
do/while
Section 6.4.1
Accumulation
Section 6.3.2 Reading
Data from a Text File
Section 6.3.1 Reading
Data from the User
Section 6.2 General Form
for while Loops
Section 5.11 The switch
Statement

20515: Write a
complete program whose class name is Hello and that
displays Hello, world on the screen.

public class Hello

public static void main( String [] args )

System.out.println( "Hello, world"


);

System.exit( 0 );

http://javacodelabsolutions.blogspot.com/2013/09/section-21-java-application-structure.html[10/10/2015 12:37:17 PM]

Section 5.10 The


Conditional Operator
(?:)
Section 5.9.2 String
Comparison Methods
Section 5.9.1 The equals
Method
Section 5.5.2 Nested
if/else Statements
Section 5.5.1 Sequential

Java Codelab Solutions: Section 2.1 Java Application Structure

if/else Statements

Section 5.4 Selection


Using if/else

20973: Rearrange the


following code so that it forms a correct program that prints out the
letter Q:

Section 5.3 Selection


Using if/else

public class Q

public
static void main(String[] a)

System.out.println("Q");

Section 5.2 Simple


Selection with if
Section 5.1.3 Logical
Operators
Section 5.1.2 Relational
Operators

20977: Assume
that message is a Stringvariable. Write a statement to
display its value on standard output:

Section 5.1.1 Equality


Operators

System.out.println(message);

Section 3.19 Exercises,


Problems and Projects

20978: Assume
that word is a
Stringvariable. Write a statement to display the
message "Today's Word-Of-The-Day is: "
followed by the
value of word on a line by itself
on standard output.

Section 3.16 Input and


Output Using
JOptionPane Di...
Section 3.15 The Integer,
Double and Other
Wrapper...

System.out.println("Today's
Word-Of-The-Day is: " + word);

Posted by
JavaSolutions
at
11:59 AM

Section 3.13 The Math


Class
Section 3.11 Calling Static
Methods and Using
Stat...

No comments:

Section 3.10 Input from


the Console Using the
Scan...

Post a Comment

Section 3.7 The String


Class -- indexOf

Section 3.7 The String


Class -- substring
Section 3.7 The String
Class - methods, length
and...
Section 3.7 The String
Class -- concatenation
Section 3.7 The String
Class -- variables,
declara...
Section 3.3 Calling
Methods
Section 3.2: Creating
Objects Using
Constructors
Chapter 3 Object-Oriented
Programming, Part 1:
Us...
Section 9.2 Accessing
Multidimensional Array
Eleme...
Section 9.1.4 Assigning
Intial Values to
Mutlidime...

Newer Post

Home

Subscribe to:
Post Comments (Atom)

Older Post

Section 9.1.3 Combining


the Declaration and
Instan...
Section 9.1.2 Instantiating
Multidimensional
Array...
Section 2.6 Exercises,
Problems and Projects
Section 2.3.8 Shortcut
Operators
Section 2.3.7 Mixed-Type
Arithmetic and Type
Casti...
Section 2.3.5 Integer

http://javacodelabsolutions.blogspot.com/2013/09/section-21-java-application-structure.html[10/10/2015 12:37:17 PM]

Java Codelab Solutions: Section 2.1 Java Application Structure

Division and Modulus


Section 2.3.3 Operator
Precedence
Section 2.3.2 Arithmetic
Operators
Section 2.3.1 The
Assignment Operator
and Expressi...
Section 2.2.8 Constants
Section 2.2.7 String
Literals and Escape
Sequences...
Section 2.2.6 The
Assignment Operator,
Initials Va...
Section 2.2.5 Boolean
Data Type
Section 2.2.4 Character
Data Type
Section 2.2.3 FloatingPoint Data Types
Section 2.2.2 Integer Data
Types
Section 2.2.1 Declaring
Variables
Section 2.2 Data Types,
Variables and
Constants
Section 2.1 Java
Application Structure
Chapter 2 Programming
Building Blocks Java
Basics
Section 9.1.1 Declaring
Multidimensional
Arrays
Chapter 9:
Multidimensional
Arrays and the ArrayL...
Section 8.10 Exercises,
Problems , and
Projects
Section 8.6.3 Insertion
Sort
Section 8.5.2 Retrieving
Command Line
Arguments
Section 8.5.1 Using Arrays
in User-Defined
Classes...
Section 8.4 Programming
Activity 1: Working with
...
Section 8.3.4 Finding
Maximum or Minimum
Values
Section 8.3.3 Summing
the Elements of an
Array
Section 8.2 Accessing
Array Elements
Section 8.1.4 Assigning
Initial Values to Arrays
Section 8.1.3 Combining
the Declaration and
Instan...
Section 8.1.2 Instantiating
Arrays
Chapter 8 Single-

http://javacodelabsolutions.blogspot.com/2013/09/section-21-java-application-structure.html[10/10/2015 12:37:17 PM]

Java Codelab Solutions: Section 2.1 Java Application Structure

Dimensional Arrays
Section 7.18: Exercises,
Problems, and Projects
Section 7.10 The toString
and equals Methods
Section 7.8 Programming
Activity (Parking Meter)
Section 7.8 Programming
Activity (Book)
Section 7.8 Programming
Activity (Gas Tank)
Section 7.8 Programming
Activity (Value Class)
Section 7.8 Programming
Activity (Counter)
Section 7.7 Writing Data
Manipulation Methods
Section 7.6 Writing
Mutator Methods
Section 7.5 Writing
Accessor Methods
Section 7.4 Writing
Constructors
Section 7.2 Defining
Instance Variables
Section 7.1 Defining a
Class
Section 1.5.4:
Programming Activity 1:
Writing a...
Section 1.5.3: Developing
a Java Application
Section 1.5.2: Program
Design with
Pseudocode
Section 1.5.1:
Programming Basics
Section 1.4.2 An
Introduction to ObjectOriented P...
Section 1.4.1: High and
Low Level Languages
Section 1.3.3:
Representing
Characters with the U...
Section 1.3.2: Using
Hexadecimal Numbers
to Repre...
Section 1.3.1 Binary
Numbers
Section 1.1: Basic
Computer Concepts
Chapter 1: Introduction to
Programming
Chapter 7: ObjectOriented Programming,
Part 2: U...

August
(3)

July
(3)

Awesome Inc. template. Powered by Blogger.

http://javacodelabsolutions.blogspot.com/2013/09/section-21-java-application-structure.html[10/10/2015 12:37:17 PM]

Java Codelab Solutions: Section 2.1 Java Application Structure

http://javacodelabsolutions.blogspot.com/2013/09/section-21-java-application-structure.html[10/10/2015 12:37:17 PM]

Você também pode gostar