HW 1 Java Basics Solution

HW 1 Java Basics Solution - Java Basics Solution / CS 302 /...

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

View Full Document Right Arrow Icon
Java Basics Solution / CS 302 / Chapters 1-2 1. What is the Java Virtual Machine (JVM) and what does it do? The JVM is a program that executes compiled Java (byte codes). It is written in software so that byte codes will run on any platform with a JVM. 2. Which of the following are invalid Java identifiers? Why? 2cool //can't start with a number tupac4ever _foo class //can't use keywords Class bobo the dog //no spaces allowed, bobo go-badgers //even for the badgers, no '-' allowed object 3. What does it mean to say that Java identifiers are case sensitive ? Case sensitive means that upper- and lowercase versions of the same letter are distinct to the compiler (i.e. Bucky and bucky are two different identifiers). 4. There are two categories of types in Java: primitive and reference. Define each category and give some examples? How are these two categories different? Are String variables of primitive or reference type? A variable of primitive type contains a single value of a fixed size and format (e.g. a number,
Background image of page 1

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

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

Page1 / 2

HW 1 Java Basics Solution - Java Basics Solution / CS 302 /...

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

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