COE 318 Midterm: COE318 – Fall 2016 Midterm

59 views11 pages

Document Summary

Q1. consider the following code: (5 marks) public class w { Identify each variable (a, b, c, d, e, f) as: static int[] a; int b; W e; int f: primitive or reference variable, instance variable, class variable, local variable or argument (parameter). 1 private int orange = 0; public void bar() { orange++; Either indicates that a compiler error would occur, or write the output of the following java code. (5 marks) public class x { public class y { Answer: compiler error public void banana() { public static void main( string [] args ) { = 32 + (8 + b. left. gett()/2)/2 + d. gett()/2. 10 public static void main(string[] args) { f. T a, b, c, d, e, f; null f = new t(10, null, null); e e = new t(20, null, null); d = new t(16, f, e); c = new t(4, null, null); = new t(8, c, null); d a = new t(32, b, d);

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents

Related Questions