spring05Prelim1 - (a) What is a class? An object? (b) Where...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (a) What is a class? An object? (b) Where does a static variable go? A non-static variable? (c) What is a parameter? An argument? (d) Name the three kinds of methods and state the use of each. (e) Below each of these 3 expressions, write its value. If evaluation leads to an error, write BAD. true || (5/0 < 1) (5/0 < 1) || true 3/2 1 CS 100J Prelim I 24 February 2005 NAME (LEGIBLY): ______________________________ CORNELL NETID:_______ (last, frst) This 90-minute exam has 6 questions worth a total of 100 points. Spend a few minutes looking at all questions before beginning to see what is expected. Budget your time wisely. Use the back of these pages if you need more space. You can tear the pages apart; we have a stapler at the front of the room. Question 0 (2 points): Write your name and NetID, legibly, at the top of each page. Question 1 (22 points): Answer the following questions concisely: Question 0 /02 Question 1 /22 Question 2 /20 Question 3 /15 Question 4 /21 Question 5 /20 Total /100 Question 2 (20 points): At the bottom of the page are two class deFnitions. Draw one folder (object, instance) of each: NAME:_____________________________ NETID:_________ 2 public class Vehicle { private int weight= 0; // Weight of vehicle /** = v1 and v2 are the same folder */ public static boolean isEqual(Vehicle v1, Vehicle v2) { return v1 == v2; } /** = this vehicles weight */ public int getWeight() {...
View Full Document

This note was uploaded on 06/01/2008 for the course CS 100 taught by Professor Fan/vanloan during the Fall '07 term at Cornell University (Engineering School).

Page1 / 5

spring05Prelim1 - (a) What is a class? An object? (b) Where...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online