quiz3_answers - EE 322C Data Structures Spring 2009...

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

View Full Document Right Arrow Icon
EE 322C Data Structures Spring 2009 Dr.Ramesh Yerraballi Quiz 3 Total points: 80 Answers 1. a) 'this' keyword cannot be used inside a static method. static members are common to all the instances of a class. public static void incrI() {i++;} b) You cannot access a non-static member inside a static method. Since static methods are common, Java does not know which Sample object's 'j' to return. Think about it!! public void incrJ() {j++;} c) It is perfectly alright to access static members inside any method of a class. d) 3:4 5:4 e) static { . .} blocks serve the purpose. The code in the block gets executed 2) a) compile time b) Java converts lower type arguments into higher type and matches the method for the call c) When a higher typed argument is passed into a method with lower type argument, downcasting does not happen automatically. integers < float < double defines the lower and higher types. 3)
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.

This note was uploaded on 09/26/2009 for the course EE 322C taught by Professor Nettles during the Spring '08 term at University of Texas.

Page1 / 2

quiz3_answers - EE 322C Data Structures Spring 2009...

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