Sheet 1 2015 (PDF)




File information


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 503 times.
File size: 279.16 KB (2 pages).
Privacy: public file










File preview


Computer Software 2015
Multiple Choice Questions:

Sheet-1

(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
executes.
(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
extension?
(7) What is a comment? What is the syntax for a comment in Java? Is the comment ignored by the
compiler?
(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
Sheet-1
(11) If the exception “NoClassFoundError:main” is raised when you run a program, what is
the cause of the error?






Download Sheet-1-2015



Sheet-1-2015.pdf (PDF, 279.16 KB)


Download PDF







Share this file on social networks



     





Link to this page



Permanent link

Use the permanent link to the download page to share your document on Facebook, Twitter, LinkedIn, or directly with a contact by e-Mail, Messenger, Whatsapp, Line..




Short link

Use the short link to share your document on Twitter or by text message (SMS)




HTML Code

Copy the following HTML code to share your document on a Website or Blog




QR Code to this page


QR Code link to PDF file Sheet-1-2015.pdf






This file has been shared publicly by a user of PDF Archive.
Document ID: 0000312995.
Report illicit content