PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Share a file Manage my documents Convert Recover PDF Search Help Contact

Sheet 1 2015 .pdf

Original filename: Sheet-1-2015.pdf
Author: Dr Ashraf

This PDF 1.5 document has been generated by Microsoft® Word 2013, and has been sent on pdf-archive.com on 05/11/2015 at 22:41, from IP address 41.37.x.x. The current document download page has been viewed 435 times.
File size: 273 KB (2 pages).
Privacy: public file

Download original PDF file

Document preview

Computer Software 2015
Multiple Choice Questions:


(1) Suppose you define a Java class as follows:
public class Test {
In order to compile this class, the class should be stored in a file named
a. Test.class
b. Test.doc
c. Test.txt
d. Test.java
e. Any name with extension .java
(2) A Java statement ends with a __________.
a. comma (,)
b. semicolon (;)
c. period (.)
d. closing brace
(3) Fill in the blanks in each of the following statements:
a) A … begins the body of every method, and a … ends the body of every method.
b) … are reserved for use by Java.
c) Methods … and … display information in the command window.
(4) State whether each of the following is true or false. If false explain why.
(a) Comments cause the computer to print the text after the // on the screen when the program
(b) All variables must be given a type when they are declared.
(5) Is Java case-sensitive? What is the case for Java keywords
(6) What is the Java source code filename extension, and what is the Java bytecode filename
(7) What is a comment? What is the syntax for a comment in Java? Is the comment ignored by the
(8) What is the statement to display a string on the console? What is the statement to display the
message “Hello world” in a message dialog box?
(9) Identify and fix the errors in the following code:
public class Welcome {
public void Main(String[] args) {
System.out.println(‘Welcome to Java!);
(10) If the exception NoClassFoundError is raised when you run a program, what is the cause
of the error?

Computer Software 2015
(11) If the exception “NoClassFoundError:main” is raised when you run a program, what is
the cause of the error?

Sheet-1-2015.pdf - page 1/2
Sheet-1-2015.pdf - page 2/2

Related documents

sheet 1 2015
sheet 2 2015
project report cpu monitor
assignment 7 writeup

Related keywords