Deck 14: Java Programming:methods, Data Types, Operators, and Classes

ملء الشاشة (f)
exit full mode
سؤال
What is the string contained in s after following lines of code?
StringBuffersnewStringBuffer("Hello");S)deleteCharAt(0);

A)Hell
B)ello
C)Hel.
D)llo.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which of these method(s) is/are used for writing bytes to an outputstream?

A)put()
B)print() and write()
C)printf()
D)write() and read()
سؤال
Which keyword is used by the method to refer to the object that invoked it?

A)import
B)catch
C)abstract
D)this
سؤال
What is the return type of a method that does not return any value?

A)int
B)float
C)void
D)double
سؤال
Which of these selection statements test only for equality?

A)if
B)switch
C)if & switch
D)none of the mentioned
سؤال
Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?

A)break
B)return
C)exit
D)continue
سؤال
Which of these is the method which is executed first before execution of any other thing takes place in a program?

A)main method
B)finalize method
C)static method
D)private method
سؤال
Which of these data type can be used for a method having a return statement in it?

A)void
B)int
C)float
D)both int and float
سؤال
If an expression contains double, int, float, long, then the whole expression will be promoted into which of these data types?

A)long
B)int
C)double
D)float
سؤال
Which of the below is invalid identifier with the main method?

A)public
B)static
C)private
D)final
سؤال
Which of these can not be used for a variable name in Java?

A)identifier
B)keyword
C)identifier & keyword
D)none of the mentioned
سؤال
which of the following can be operands of arithmetic operators?

A)Numeric
B)Boolean
C)Characters
D)Both Numeric & Characters
سؤال
How to copy contents of array?

A)System.arrayCopy()
B)Array.copy()
C)Arrays.copy()
D)Collection.copy()
سؤال
Which of these are selection statements in Java?

A)if()
B)for()
C)continue
D)break
سؤال
Which of these operators is used to allocate memory for an object?

A)malloc
B)alloc
C)new
D)give
سؤال
Which of these packages contains the exception Stack Overflow in Java?

A)java.lang
B)java.util
C)java.io
D)java.system
سؤال
Which of this method of class String is used to obtain a length of String object?

A)get()
B)Sizeof()
C)lengthof()
D)length()
سؤال
Which of these methods of a Thread class is used to suspend a thread for a period of time?

A)sleep()
B)terminate()
C)suspend()
D)stop()
سؤال
Which of these exceptions will be thrown if we use null reference for an arithmetic operation?

A)ArithmeticException
B)NullPointerException
C)IllegalAccessException
D)IllegalOperationException
سؤال
Which of the interface contains all the methods used for handling thread related operations in Java?

A)Runnable interface
B)Math interface
C)System interface
D)ThreadHandling interface
سؤال
Which of these class is used to read and write bytes in a file?

A)FileReader
B)FileWriter
C)FileInputStream
D)InputStreamReader
سؤال
Which of these classes is used for input and output operation when working with bytes?

A)InputStream
B)Reader
C)Writer
D)All of the mentioned
سؤال
Which of these class is a superclass of all other classes?

A)Math
B)Process
C)System
D)Object
سؤال
Which of these class is not a member class of java.io package?

A)String
B)StringReader
C)Writer
D)File
سؤال
Which of these class is not related to input and output stream in terms of functioning?

A)File
B)Writer
C)InputStream
D)Reader
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/25
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 14: Java Programming:methods, Data Types, Operators, and Classes
1
What is the string contained in s after following lines of code?
StringBuffersnewStringBuffer("Hello");S)deleteCharAt(0);

A)Hell
B)ello
C)Hel.
D)llo.
ello
2
Which of these method(s) is/are used for writing bytes to an outputstream?

A)put()
B)print() and write()
C)printf()
D)write() and read()
print() and write()
3
Which keyword is used by the method to refer to the object that invoked it?

A)import
B)catch
C)abstract
D)this
this
4
What is the return type of a method that does not return any value?

A)int
B)float
C)void
D)double
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of these selection statements test only for equality?

A)if
B)switch
C)if & switch
D)none of the mentioned
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?

A)break
B)return
C)exit
D)continue
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of these is the method which is executed first before execution of any other thing takes place in a program?

A)main method
B)finalize method
C)static method
D)private method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which of these data type can be used for a method having a return statement in it?

A)void
B)int
C)float
D)both int and float
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
9
If an expression contains double, int, float, long, then the whole expression will be promoted into which of these data types?

A)long
B)int
C)double
D)float
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which of the below is invalid identifier with the main method?

A)public
B)static
C)private
D)final
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of these can not be used for a variable name in Java?

A)identifier
B)keyword
C)identifier & keyword
D)none of the mentioned
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
12
which of the following can be operands of arithmetic operators?

A)Numeric
B)Boolean
C)Characters
D)Both Numeric & Characters
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
13
How to copy contents of array?

A)System.arrayCopy()
B)Array.copy()
C)Arrays.copy()
D)Collection.copy()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
14
Which of these are selection statements in Java?

A)if()
B)for()
C)continue
D)break
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of these operators is used to allocate memory for an object?

A)malloc
B)alloc
C)new
D)give
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of these packages contains the exception Stack Overflow in Java?

A)java.lang
B)java.util
C)java.io
D)java.system
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which of this method of class String is used to obtain a length of String object?

A)get()
B)Sizeof()
C)lengthof()
D)length()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
18
Which of these methods of a Thread class is used to suspend a thread for a period of time?

A)sleep()
B)terminate()
C)suspend()
D)stop()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of these exceptions will be thrown if we use null reference for an arithmetic operation?

A)ArithmeticException
B)NullPointerException
C)IllegalAccessException
D)IllegalOperationException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the interface contains all the methods used for handling thread related operations in Java?

A)Runnable interface
B)Math interface
C)System interface
D)ThreadHandling interface
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of these class is used to read and write bytes in a file?

A)FileReader
B)FileWriter
C)FileInputStream
D)InputStreamReader
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which of these classes is used for input and output operation when working with bytes?

A)InputStream
B)Reader
C)Writer
D)All of the mentioned
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of these class is a superclass of all other classes?

A)Math
B)Process
C)System
D)Object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of these class is not a member class of java.io package?

A)String
B)StringReader
C)Writer
D)File
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of these class is not related to input and output stream in terms of functioning?

A)File
B)Writer
C)InputStream
D)Reader
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.