{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

EE3206 Test 1 Solution - arguments Question 8(2 marks...

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

View Full Document Right Arrow Icon
EE3206/EE5805 Java Programming and Applications Test One Solution Question 1 (1 marks) Java is compiled into bytecode Question 2 (3 marks) Package is used to organize java classes into different namespaces. cd c:\w\x java y.z.MyClass Question 3 (2 marks) final float PI = 3.14 f ; Question 4 (1 marks) var3 = var2 + var1; Question 5 (1 mark) Integer x = 10; Question 6 (1 mark) It is used for dynamic memory allocation/storing objects. Question 7 (2 marks) Method signature is the combination of the method name and the parameter list . Because the target of method invocation is identified by method signature , two methods of the same method name can be distinguished by the types of their input
Image of page 1

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

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

Unformatted text preview: arguments. Question 8 (2 marks) public static char getRandomCharacter() { return (char) (‘g’ + Math.random() * (‘p’ – ‘g’ + 1)); } Question 9 (5 marks) public static int[][] subtractMatrix(int[][] m1, int[][] m2) { int row1 = m1.length; int col1 = m1[0].length; int row2 = m2.length; int col2 = m2[0].length; int[][] result = new int[row1][col1]; if (row1 == row2 && col1 == col2) { for (int i = 0; i < row1; i++) { for (int j = 0; j < col1; j++) { result[i][j] = m1[i][j] - m2[i][j]; } } return result; } else { return null; } }...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern