COMP 110 NOTES

COMP 110 NOTES - COMP 110 NOTES- Different Error types,...

Info iconThis preview shows pages 1–2. 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: COMP 110 NOTES- Different Error types, runtime, syntax, logic- A class type is used for a class of objects and has both data and methods.- Have fun! is a value of class type String- A primitive type is used for simple, nondecomposable values such as an individual number or individual character.- int, double , and char are primitive types- points = (int)distance; <- how to typecast String str1 = "cat"; String str2 = "Cat"; Determine whether the statement str1.equals(str2); is true or false. Statement is false- case sensitive UML diagram Class Name: Student Name (String) Class Year (int) GPA (double) Major (String) Credits (int) + getMajor(): String + increaseYear(): void + updateGPA(double grade, int credit): void + printData(): void Static Methods- Methods that do not require an object of any kind Overloading public class Statistician { Public static void main(String args) { double average1 = Statistician.average(40.0, 50.0); double average2 = Statistician.average(1.0, 2.0, 3.0); } public static double average(double first, double second) {...
View Full Document

This note was uploaded on 11/03/2009 for the course BIOL 90726 taught by Professor Weakley during the Spring '09 term at UNC.

Page1 / 3

COMP 110 NOTES - COMP 110 NOTES- Different Error types,...

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