Deck 1: Getting Started

ملء الشاشة (f)
exit full mode
سؤال
Java began as a language for home appliances.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The Java programming language allows you to concatenate two strings using the plus sign.
سؤال
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;
سؤال
To mark a block comment for inclusion in the Javadoc documentation,the block must be delimited by:

A)/** */
B)*/* */
C)**/ /*
D)**/ */
سؤال
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
سؤال
Java is an interpreted language.
سؤال
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)*/ */
سؤال
What is the Java expression for 27xy?

A)27 + x * y)
B)27 * x + y)
C)27 * x * y
D)27x * y
سؤال
Which operator is used to concatenate two strings?

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.
سؤال
Which operator returns the remainder of integer division?

A)%
B)/
C)*
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
سؤال
Identify the invalid Java identifier.

A)1Week
B)Week1
C)amountDue
D)amount_due
سؤال
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 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
سؤال
In Java,the equal sign is used as the ___________ operator.

A)increment
B)decrement
C)assignment
D)negation
سؤال
Applets were designed to run as stand-alone applications.
سؤال
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.charAt10);

A)w
B)h
C)i
D)None of the above
سؤال
In Java,source code is compiled into object code called ______________.

A)Bit-code
B)Class code
C)Method code
D)Byte-code
سؤال
What is the syntax and semantics of a programming language?
سؤال
List the primitive data types Java supports.Indicate the kind of values each type can store.
سؤال
Java does not require that a variable be declared before it is used within a program.
سؤال
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;
سؤال
Explain the difference between an implicit type cast and an explicit type cast.
سؤال
Two kinds of Java programs are applications and applets.Define and discuss each.
سؤال
The result of integer division is truncated in Java.
سؤال
A variable of type boolean can be explicitly converted to that of type int.
سؤال
An advantage of using the Unicode character set is that it easily handles languages other than English.
سؤال
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);
سؤال
What does the String method trim)do? Give an example of its use.
سؤال
Objects of type String are strings of characters that are written within single quotes.
سؤال
Java uses the ASCII character set.
سؤال
The modulus operator,%,returns the remainder of integer division.
سؤال
In Java,Strings are immutable objects.Immutable objects can be changed.
سؤال
What is byte-code? What is its importance?
سؤال
Define the terms class,object,method and method call.
سؤال
Define high-level languages,machine language and low-level language.Explain how the languages correspond to one another.
سؤال
How is the % modulus)operator used? What is the common use of the modulus operator?
سؤال
What steps must the programmer take to create an executable Java program?
سؤال
Write a Java statement to access the 7< sup >th< /sup > character in the String variable myString and place it in the char variable c.
سؤال
Why is using named constants a good programming practice?
سؤال
How are line comments and block comments used?
سؤال
Write a Java statement to determine the length of a string variable called input.Store the result in an integer variable called strLength.
سؤال
What is the output of the following Java statements?
//String method examples
String str = "Java Programming!";
System.out.printlnstr.equals"Java Programming!"));
System.out.printlnstr.toLowerCase));
System.out.printlnstr.toUpperCase));
System.out.printlnstr.substring5,8));
System.out.printlnstr.lastIndexOf"m"));
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/45
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 1: Getting Started
1
Java began as a language for home appliances.
True
2
The Java programming language allows you to concatenate two strings using the plus sign.
True
3
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;
D
4
To mark a block comment for inclusion in the Javadoc documentation,the block must be delimited by:

A)/** */
B)*/* */
C)**/ /*
D)**/ */
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
5
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
6
Java is an interpreted language.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
7
The escape sequence the represents the new-line character is:

A)\r
B)\t
C)\n
D)\\
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
8
In Java,a block comment is delimited by:

A)*/ /*
B)/* /*
C)/* */
D)*/ */
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
9
What is the Java expression for 27xy?

A)27 + x * y)
B)27 * x + y)
C)27 * x * y
D)27x * y
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which operator is used to concatenate two strings?

A)+
B)-
C)*
D)/
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
11
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
12
Which operator returns the remainder of integer division?

A)%
B)/
C)*
D)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
13
What is the value of 7.52e-5?

A)752000.0
B)0.0000752
C)0.000752
D)0.00752
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
14
Identify the invalid Java identifier.

A)1Week
B)Week1
C)amountDue
D)amount_due
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
15
The value of the expression int)27.6 evaluates to:

A)28
B)27
C)26
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
16
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
17
In Java,the equal sign is used as the ___________ operator.

A)increment
B)decrement
C)assignment
D)negation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
18
Applets were designed to run as stand-alone applications.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
19
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.charAt10);

A)w
B)h
C)i
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
20
In Java,source code is compiled into object code called ______________.

A)Bit-code
B)Class code
C)Method code
D)Byte-code
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
21
What is the syntax and semantics of a programming language?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
22
List the primitive data types Java supports.Indicate the kind of values each type can store.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
23
Java does not require that a variable be declared before it is used within a program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
24
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;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
25
Explain the difference between an implicit type cast and an explicit type cast.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
26
Two kinds of Java programs are applications and applets.Define and discuss each.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
27
The result of integer division is truncated in Java.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
28
A variable of type boolean can be explicitly converted to that of type int.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
29
An advantage of using the Unicode character set is that it easily handles languages other than English.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
30
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
31
What does the String method trim)do? Give an example of its use.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
32
Objects of type String are strings of characters that are written within single quotes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
33
Java uses the ASCII character set.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
34
The modulus operator,%,returns the remainder of integer division.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
35
In Java,Strings are immutable objects.Immutable objects can be changed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
36
What is byte-code? What is its importance?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
37
Define the terms class,object,method and method call.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
38
Define high-level languages,machine language and low-level language.Explain how the languages correspond to one another.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
39
How is the % modulus)operator used? What is the common use of the modulus operator?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
40
What steps must the programmer take to create an executable Java program?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
41
Write a Java statement to access the 7< sup >th< /sup > character in the String variable myString and place it in the char variable c.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
42
Why is using named constants a good programming practice?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
43
How are line comments and block comments used?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
44
Write a Java statement to determine the length of a string variable called input.Store the result in an integer variable called strLength.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
45
What is the output of the following Java statements?
//String method examples
String str = "Java Programming!";
System.out.printlnstr.equals"Java Programming!"));
System.out.printlnstr.toLowerCase));
System.out.printlnstr.toUpperCase));
System.out.printlnstr.substring5,8));
System.out.printlnstr.lastIndexOf"m"));
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 45 في هذه المجموعة.