Deck 1: Getting Started

ملء الشاشة (f)
exit full mode
سؤال
In Java,the equal sign is used as the ___________ operator.
(a)increment
(b)decrement
(c)assignment
(d)negation
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which operator returns the remainder of integer division?
(a)%
(b)/
(c)*
(d)none of the above
سؤال
Applets were designed to run as stand-alone applications.
سؤال
What is the value of the variable amountDue?
Double price = 2.50;
Double quantity = 5;
Double amountDue = 0;
AmountDue = price * quantity;
(a)12
(b)12.25
(c)12.5
(d)13
سؤال
The Java programming language allows you to concatenate two strings using the plus sign.
سؤال
Identify the invalid Java identifier.
(a)1Week
(b)Week1
(c)amountDue
(d)amount_due
سؤال
In Java,source code is compiled into object code called ______________.
(a)Bit-code
(b)Class code
(c)Method code
(d)Byte-code
سؤال
To mark a block comment for inclusion in the Javadoc documentation,the block must be delimited by:
(a)/** */
(b)*/* */
(c)**/ /*
(d)**/ */
سؤال
Which operator is used to concatenate two strings?
(a)+
(b)-
(c)*
(d)/
سؤال
What is the Java expression for 4a2 + 2b * c?
(a)(4 * a)+ (2 * b)* c
(b)(4 * a * a)+ ((2 * b)* c)
(c)((4 * a * a)+ (2 * b))* c
(d)(4 + a * a)+ ((2 + b)* c)
سؤال
What is the value of the variable c in the statements that follow?
String phrase = "Make hay while the sun is shining.";
Char c = phrase.charAt(10);
(a)w
(b)h
(c)i
(d)None of the above
سؤال
The hardest kind of error to detect in a computer program is a:
(a)Syntax error
(b)Run-time error
(c)Logic error
(d)All of the above
سؤال
What is the Java expression for 27xy?
(a)27 + (x * y)
(b)27 * (x + y)
(c)27 * x * y
(d)27x * y
سؤال
The escape sequence the represents the new-line character is:
(a)\r
(b)\t
(c)\n
(d)\\
سؤال
In Java,a block comment is delimited by:
(a)*/ /*
(b)/* /*
(c)/* */
(d)*/ */
سؤال
Java is an object-oriented programming language.An object-oriented language
(a)Uses structured programming.
(b)Views a program as consisting of objects which communicate through interactions.
(c)Functionally breaks down problems into smaller,more manageable problems.
(d)All of the above.
سؤال
The syntax that declares a Java named constant named SALES_TAX is:
(a)double SALES_TAX = 7.50;
(b)public double SALES_TAX = 7.50;
(c)public static double SALES_TAX = 7.50;
(d)public static final double SALES_TAX = 7.50;
سؤال
The value of the expression (int)27.6 evaluates to:
(a)28
(b)27
(c)26
(d)None of the above.
سؤال
What is the value of 7.52e-5?
(a)752000.0
(b)0.0000752
(c)0.000752
(d)0.00752
سؤال
Java began as a language for home appliances.
سؤال
There are two kinds of Java programs,applications and applets.Define and discuss each.
سؤال
A variable of type boolean can be explicitly converted to that of type int.
سؤال
Objects of type String are strings of characters that are written within single quotes.
سؤال
How is the % (modulus)operator used? What is the common use of the modulus operator?
سؤال
What is byte-code? What is its importance?
سؤال
Explain the difference between an implicit type cast and an explicit type cast.
سؤال
An advantage of using the Unicode character set is that it easily handles languages other than English.
سؤال
What steps must the programmer take to create an executable Java program?
سؤال
What is the syntax and semantics of a programming language?
سؤال
Java uses the ASCII character set.
سؤال
In Java,Strings are immutable objects.Immutable objects can be changed.
سؤال
Define high-level languages,machine language and low-level language.Explain how the languages correspond to one another.
سؤال
Define the terms class,object,method and method call.
سؤال
Java is an interpreted language.
سؤال
List the primitive data types Java supports.Indicate the kind of values each type can store.
سؤال
The modulus operator,%,returns the remainder of integer division.
سؤال
Java does not require that a variable be declared before it is used within a program.
سؤال
The result of integer division is truncated in Java.
سؤال
What are the values of the variables a,b,c,and d after the execution of the following expressions?
Int a = 3;
Int b = 12;
Int c = 6;
Int d = 1;
D = d * a;
C = c + 2 * a;
D = d - b / c;
C = c * b % c;
B = b / 2;
سؤال
What is the output produced by the following lines of code?
int value1 = 3;
int value2 = 4;
int result = 0;
result = value1++ * value2--;
System.out.println("Post increment/decrement: " + result);
result = ++value1 * --value2;
System.out.println("Pre increment/decrement: " + result);
سؤال
Why is using named constants a good programming practice?
سؤال
What does the String method trim()do? Give an example of its use.
سؤال
Write a Java statement to determine the length of a string variable called input.Store the result in an integer variable called strLength.
سؤال
Write a Java statement to access the 7th character in the String variable myString and place it in the char variable c.
سؤال
How are line comments and block comments used?
سؤال
What is the output of the following Java statements?
//String method examples
String str = "Java Programming!";
System.out.println(str.equals("Java Programming!"));
System.out.println(str.toLowerCase());
System.out.println(str.toUpperCase());
System.out.println(str.substring(5,8));
System.out.println(str.lastIndexOf("m"));
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/46
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 1: Getting Started
1
In Java,the equal sign is used as the ___________ operator.
(a)increment
(b)decrement
(c)assignment
(d)negation
C
2
Which operator returns the remainder of integer division?
(a)%
(b)/
(c)*
(d)none of the above
A
3
Applets were designed to run as stand-alone applications.
False
4
What is the value of the variable amountDue?
Double price = 2.50;
Double quantity = 5;
Double amountDue = 0;
AmountDue = price * quantity;
(a)12
(b)12.25
(c)12.5
(d)13
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
5
The Java programming language allows you to concatenate two strings using the plus sign.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
6
Identify the invalid Java identifier.
(a)1Week
(b)Week1
(c)amountDue
(d)amount_due
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
7
In Java,source code is compiled into object code called ______________.
(a)Bit-code
(b)Class code
(c)Method code
(d)Byte-code
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
8
To mark a block comment for inclusion in the Javadoc documentation,the block must be delimited by:
(a)/** */
(b)*/* */
(c)**/ /*
(d)**/ */
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which operator is used to concatenate two strings?
(a)+
(b)-
(c)*
(d)/
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
10
What is the Java expression for 4a2 + 2b * c?
(a)(4 * a)+ (2 * b)* c
(b)(4 * a * a)+ ((2 * b)* c)
(c)((4 * a * a)+ (2 * b))* c
(d)(4 + a * a)+ ((2 + b)* c)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
11
What is the value of the variable c in the statements that follow?
String phrase = "Make hay while the sun is shining.";
Char c = phrase.charAt(10);
(a)w
(b)h
(c)i
(d)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
12
The hardest kind of error to detect in a computer program is a:
(a)Syntax error
(b)Run-time error
(c)Logic error
(d)All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
13
What is the Java expression for 27xy?
(a)27 + (x * y)
(b)27 * (x + y)
(c)27 * x * y
(d)27x * y
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
14
The escape sequence the represents the new-line character is:
(a)\r
(b)\t
(c)\n
(d)\\
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
15
In Java,a block comment is delimited by:
(a)*/ /*
(b)/* /*
(c)/* */
(d)*/ */
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
16
Java is an object-oriented programming language.An object-oriented language
(a)Uses structured programming.
(b)Views a program as consisting of objects which communicate through interactions.
(c)Functionally breaks down problems into smaller,more manageable problems.
(d)All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
17
The syntax that declares a Java named constant named SALES_TAX is:
(a)double SALES_TAX = 7.50;
(b)public double SALES_TAX = 7.50;
(c)public static double SALES_TAX = 7.50;
(d)public static final double SALES_TAX = 7.50;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
18
The value of the expression (int)27.6 evaluates to:
(a)28
(b)27
(c)26
(d)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
19
What is the value of 7.52e-5?
(a)752000.0
(b)0.0000752
(c)0.000752
(d)0.00752
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
20
Java began as a language for home appliances.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
21
There are two kinds of Java programs,applications and applets.Define and discuss each.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
22
A variable of type boolean can be explicitly converted to that of type int.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
23
Objects of type String are strings of characters that are written within single quotes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
24
How is the % (modulus)operator used? What is the common use of the modulus operator?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
25
What is byte-code? What is its importance?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
26
Explain the difference between an implicit type cast and an explicit type cast.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
27
An advantage of using the Unicode character set is that it easily handles languages other than English.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
28
What steps must the programmer take to create an executable Java program?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
29
What is the syntax and semantics of a programming language?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
30
Java uses the ASCII character set.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
31
In Java,Strings are immutable objects.Immutable objects can be changed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
32
Define high-level languages,machine language and low-level language.Explain how the languages correspond to one another.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
33
Define the terms class,object,method and method call.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
34
Java is an interpreted language.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
35
List the primitive data types Java supports.Indicate the kind of values each type can store.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
36
The modulus operator,%,returns the remainder of integer division.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
37
Java does not require that a variable be declared before it is used within a program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
38
The result of integer division is truncated in Java.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
39
What are the values of the variables a,b,c,and d after the execution of the following expressions?
Int a = 3;
Int b = 12;
Int c = 6;
Int d = 1;
D = d * a;
C = c + 2 * a;
D = d - b / c;
C = c * b % c;
B = b / 2;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
40
What is the output produced by the following lines of code?
int value1 = 3;
int value2 = 4;
int result = 0;
result = value1++ * value2--;
System.out.println("Post increment/decrement: " + result);
result = ++value1 * --value2;
System.out.println("Pre increment/decrement: " + result);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
41
Why is using named constants a good programming practice?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
42
What does the String method trim()do? Give an example of its use.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
43
Write a Java statement to determine the length of a string variable called input.Store the result in an integer variable called strLength.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
44
Write a Java statement to access the 7th character in the String variable myString and place it in the char variable c.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
45
How are line comments and block comments used?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
46
What is the output of the following Java statements?
//String method examples
String str = "Java Programming!";
System.out.println(str.equals("Java Programming!"));
System.out.println(str.toLowerCase());
System.out.println(str.toUpperCase());
System.out.println(str.substring(5,8));
System.out.println(str.lastIndexOf("m"));
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.