Intro To Java

42 Questions  I  By Briitanii
Java Script test

  
Changes are done, please start the quiz.


Question Excerpt

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
1.  Another term for program is:
A.
B.
C.
D.
2.  The major components of a typical computer system consist of
A.
B.
C.
D.
E.
3.  A byte is a collection of
A.
B.
C.
D.
4.  A(n)______________is a special programming language used to write computer programs.
A.
B.
C.
D.
E.
5.  Syntax is
A.
B.
C.
D.
6.  Variables are:
A.
B.
C.
D.
7.  A software entity that contains data and procedures is a(n)
A.
B.
C.
D.
8.  RAM is usually
A.
B.
C.
D.
E.
9.  A computer program is
A.
B.
C.
D.
10.  Key words are
A.
B.
C.
D.
11.  _________ are used to indicate the end of a Java statement
A.
B.
C.
D.
12.  If the following Java statements are executed, what will be displayedSystem.out.println("The top three winners are \n");System.out.println("Jody, the Giant \n");System.out.print("Buffy, the Dwarf");System.out.print("Adelle, the Albino");
A.
B.
C.
D.
13.  A(n) _______ is a value that is written into the code of a program
A.
B.
C.
D.
14.  Which of the following is not a primitive data type?
A.
B.
C.
D.
15.  The boolean data type may contain values in the following range of values
A.
B.
C.
D.
16.  Character literals are enclosed in _________; string literals are enclosed in_______.
A.
B.
C.
D.
17.  What is the result of the following statement?25/4+4*10%3
A.
B.
C.
D.
18.  Which of the following will correctly convert the data type, if x is an integer and y is a double?
A.
B.
C.
D.
19.  In the following Java statement what is the value of the variable, name?
A.
B.
C.
D.
20.  To display the output on the next line, you can use the println method or use the escape sequence _________, in the print method.
A.
B.
C.
D.
21.  What would be displayed as a result of the follwing code, assuming x has been declared an integer?x=578;System.out.print("There are " + x + "5 \n" + "hens in the hen house.");
A.
B.
C.
D.
22.  If x has been declared an integer, int x;, which of the following is invalid?
A.
B.
C.
D.
23.  Given double r;, which of the following is invalid
A.
B.
C.
D.
24.  Variables of the boolean data type are useful for
A.
B.
C.
D.
25.  What is the result of the following statement?17%3*2-12+15
A.
B.
C.
D.
26.  What will be displayed after the following statements have been executed? int x = 15, y = 20, z = 32; x *= y; y –= z; z% = 16; System.out.println(“x = ” + x + “, y = ” + y, “ z = ” +z);
A.
B.
C.
D.
27.  A(n) ____ is a variable whose content is read only and cannot be changed during the program’s execution of the program.
A.
B.
C.
D.
28.  Which of the following expressions will check to see if x is less than or equal to y?
A.
B.
C.
D.
29.  What will be the value of x after the following code is executed? int x = 75; int y = 60; if (x > y) x = x – y;
A.
B.
C.
D.
30.  What will be the value of ans after the following code has been executed? int x = 65; int y = 55; if (x >= y) int ans = x + y;
A.
B.
C.
D.
31.  What will be the value of ans after the following code has been executed? int x = 90, y = 55, ans = 10; if ( x == y); ans *= 2; a.        10 b.         145 c.         20 d.         No value, there is a syntax error
A.
B.
C.
D.
32.  If chr is a character variable, which of the following if statements is correct? a.         if (chr = “a”) b.         if (chr == “a”) c.         if (chr = ‘a’) d.         if (chr == ‘a’)
A.
B.
C.
D.
33.  What will be the value of bonus after the following code is executed? int bonus, sales = 10000; if (sales < 5000)             bonus = 200; else if (sales < 7500)             bonus = 500; else if (sales < 10000)             bonus = 750; else if (sales < 20000)             bonus = 1000; else             bonus = 1250; a.         200 b.         500 c.         750 d.         1000 e.         1250
A.
B.
C.
D.
E.
34.  What would be the value of bonus after the following statements are executed? int bonus, sales = 85000; char dept = ‘S’; if (sales > 100000)             if (dept == ‘R’)                         bonus = 2000; else             bonus = 1500; else if (sales > 75000)             if (dept == ‘R’)                         bonus = 1250;             else                         bonus = 1000; else             bonus = 0; a.         2000 b.         1500 c.         1250 d.         1000
A.
B.
C.
D.
35.  Which of the following is the correct boolean expression to test for: int x being a value between, but not including, 500 and 650, or int y not equal to 1000? a.         ((x >= 500 && x <= 650) && (y != 1000)) b.         ((x > 500 AND x < 650) OR !(y.equal(1000))) c.         ((x > 500 && x < 650) || (y != 1000)) d.         ((x < 500 && x > 650) || !(y == 1000))
A.
B.
C.
D.
36.   The expression in an if statement must evaluate to a.         0 or 1 b.         +1 or –1 c.         true or false d.         T or F
A.
B.
C.
D.
37.  27. _____ operators are used to determine whether a specific relationship exists between two values. a.         Arithmetic b.         Relational c.         Syntactical d.         Assignment
A.
B.
C.
D.
38.  28. What is the value of x after the following code has been executed? int x = 75; int y = 90; if ( x != y) x += y; a.         75 b.         90 c.         15 d.         165
A.
B.
C.
D.
39.  Each byte is assigned to a unique number known as an address.
A.
B.
40.  The following truth table shows various combinations of the values true and false connected by a logical operator. Complete the table by answering T or F to indicate if the result of such a combination is true or false________ true && false________ true && true________ true || false________ false || !false________ !(true && false)________ !(!false)________ !(!true || false)
41.   A Java program must have at least one a.         Class definition b.         Variable c.         Comment d.         System.out.println(); statement
A.
B.
C.
D.
42.  All Java lines of code end with semicolons. a.         True b.         False
A.
B.
Back to top


to post comments.

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz