Mr. Truncale - Robert E. Lee High School
  • Home
  • Digital Media
    • HTML
  • Video Game Design
  • Comp. Programming I
  • Comp. Programming II
  • AP Computer Science
  • 3D Printing
  • Teacher Resources
  • Contact Me

    Java Test 1-3


    1. What is wrong with the following “skeleton” of a Java program?

    public class MyClass
    {
       public static void main(String args[])
       {
       }
    }


    3. What is actually printed with the following code?

    System.out.print(“Fire”);
    System.out.println(“ Ants”);







    10. What is output by the following code?

    String s = “Mona Lisa”;
    System.out.println(s.length( ));

    11. What is output by the following code?

    String girl = “Heather Jones”;
    System.out.println(girl.substring(8));

    12. What is output by the following code?

    String girl = “Heather Jones”;
    System.out.println(girl.substring(8,11));


    14. What is output by the following code?

    String s = “Beaver Cleaver”;
    System.out.println(s.toUpperCase( ));

    15. CODE PART

    Given:

    String name = "Bill Gates";

    Use the string name and the substring method as shown in lesson 3 to display the output below:

    Your first name is Bill.
    Your last name is Gates.
Submit
Robert E. Lee High School
1809 Market
Baytown, TX 77520
281-420-4535
digital media | computer programming I and II | BIM
ap computer science | architectural cad | video game design
national technical honor society | contact me