A syntax error is:
A. An error that is not detected until a program is run
A grammatical mistake in the code
A mistake in the undelaying algorithm for a program
None of the above
The following variable name (class) is not allowed because:
The variable name contains a space
The variable name contains special characters
The variable name is a reserved word
The variable name starts with a number
Consider the following declaration: boolean iKnow; The variable iKnow will be automatically initialized to which of the following?
0
1
True
False
The String class belongs to the package:
Java.net
. java.util
Java.awt
Java.lang
Java is
Object oriented programming language
Event driven programming language
Procedural programming language
None of the above
In Java, a block comment (multiline comment) is represented by:
*/ /*
//
/* */
" "
Which of the following String methods will return -1 if the string is not found:
CharAt(postion)
IndexOf(String)
Length()
CompareTo(String)
ÂĤâĤâĤâĤA program that translates a high-level language program into an equivalent low-level language program:
Compiler
Class loader
Interpreter
JRE
Which of the following is not a Java primitive data type?
Short
Long
Float
String
What is the result of the following expression? 10 + 5 * 3 â 20
-5
5
25
-50
.Which of the following is not an arithmetic operator in Java?
>
-
*
%
The Boolean expression ((6>=6) && (1>0)) will result to_________.
True
False
Null
None of the above
.The following variable name (double) is not allowed because:
The variable name contains a space
The variable name contains special characters
The variable name is a reserved word
The variable name starts with a number
The default value of a char variable is:
False
True
0
' '
Semantics is:
The meaning of things written while following the syntax rules
The grammar rules of a language
The logical error made by the user
. All of the above
Which operator is used to concatenate two strings:
*
+
'
/
What is the output of the following code: String examDay= "SUNDAY"; System.out.println(examDay.substring(3));
SUNDAY
UNDAY
NDAY
DAY
Which of the following statements is used to run the program FirstProgram:
Java FirstProgram.java
FirstProgram.java
Javac FirstProgram.java
Java FirstProgram
.Which of the following String methods will return -1 if the string is not found:
CharAt(postion)
IndexOf(String)
LastIndexOf(String)
. compareTo(String)
.A Java program that is meant to be run from a web browser is:
A Java application
A Java applet
A system software
A data
. Which of the following Java statements is illegal:
Int a= 5.7;
Double b= 3;
int a = (int) 3.4;
Double ans = n/ (double) m;
Which of the following is not a valid Java identifier?
Answer_7
Highest$
Myname
2ndlevel
The Boolean expression !(6>=6 || 1>0) will result to:
True
False
Null
None of the above
Which of the following statements will compile the Java program with name Students:
Java Students.java
Javac Students.java
Students.java
Javac Students
There are two type of Java Programs:
Applications and Applets
Applets and comilers
Machine code and Applications
Main method and class
.The output of the following code is: int a = 4; System.out.println(++a);
4
3
5
All of the above
Identify the error in this code: char grade= "A";
No errors in the code
The type should be written character not char
The value should be in a single quotes ' ' not double quotation " "
The variable name is not allowed
The output of the following code is: String s1= "ICS102 is an easy course"; System.out.println(s1.indexOf ("easy"));
16
12
4
13
The output of the following code is: String s1= "ICS102 is an easy course"; System.out.println(s1.charAt(7));
I
A
C
2
.The escape sequence that represents the tab is:
/n
/r
/t
//
What is the output of the following code: String examDay= "SUNDAY"; System.out.println(examDay.charAt(2));
S
U
N
Y
What is the value of the following expression (+ + a) / 5 when a= 4:
3
1
8
2
.This expression sum + = 3 is equivalent to:
Sum = sum â 3
Sum = 3
Sum = sum + 3
Sum + 3
The Java compiler translates Java source code into:
Java byte-code
C++
Assembly code
Java Virtual Machine
Which of the following is not a valid Java identifier?
Answer_7
Highest$
Myname
2ndlevel
.Which of the following is a valid Java statement?
String str = 'University of Hail';
String str = "University of Hail";
String str = 'University of Hail';
String str = "University of Hail";
The main method is of type:
Return
Constructor
Class
Void
Which one of the following is the not equal operator?
< >
NOT
*&
!=
{"name":"A syntax error is:", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"A syntax error is:, The following variable name (class) is not allowed because:, Consider the following declaration: boolean iKnow; The variable iKnow will be automatically initialized to which of the following?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}