Deck 7: Java Programming Concepts
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/20
Play
Full screen (f)
Deck 7: Java Programming Concepts
1
What is byte code in the context of Java?
A)The type of code generated by a Java compiler
B)The type of code generated by a Java Virtual Machine
C)It is another name for a Java source file
D)It is the code written within the instance methods of a class.
A)The type of code generated by a Java compiler
B)The type of code generated by a Java Virtual Machine
C)It is another name for a Java source file
D)It is the code written within the instance methods of a class.
The type of code generated by a Java compiler
2
What is garbage collection in the context of Java?
A)The operating system periodically deletes all of the java files available on the system.
B)Any package imported in a program and not used is automatically deleted.
C)When all references to an object are gone, the memory used by the object is automatically reclaim
A)The operating system periodically deletes all of the java files available on the system.
B)Any package imported in a program and not used is automatically deleted.
C)When all references to an object are gone, the memory used by the object is automatically reclaim
When all references to an object are gone, the memory used by the object is automatically reclaim
3
What is different between a Java applet and a Java application?
A)An application can in general be trusted whereas an applet can't.
B)An applet must be executed in a browser environment.
C)An applet is not able to access the files of the computer it runs on
D)All of the above
A)An application can in general be trusted whereas an applet can't.
B)An applet must be executed in a browser environment.
C)An applet is not able to access the files of the computer it runs on
D)All of the above
All of the above
4
JAR stands for?
A)Java Archive
B)Java Archive Runner
C)Java Application Runner
D)None of the above
A)Java Archive
B)Java Archive Runner
C)Java Application Runner
D)None of the above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
5
What are the pillars of OOPS concept?
A)Abstraction, Inheritance, Encapsulation, Polymorphism
B)Atomicity, Inheritance, Encapsulation, Polymorphism
C)Abstraction, Inheritance, Polymorphism
D)None of the Above
A)Abstraction, Inheritance, Encapsulation, Polymorphism
B)Atomicity, Inheritance, Encapsulation, Polymorphism
C)Abstraction, Inheritance, Polymorphism
D)None of the Above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
6
What is the default buffer size used by any buffered class?
A)128 bytes
B)256 bytes
C)512 bytes
D)1024 bytes
A)128 bytes
B)256 bytes
C)512 bytes
D)1024 bytes
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
7
Which class cannot be a subclass in java
A)Abstract class
B)Parent class
C)Final class
D)None of above
A)Abstract class
B)Parent class
C)Final class
D)None of above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
8
Why we use array as a parameter of main method
A)It is syntax
B)Can store multiple values
C)Both of above
D)None of above
A)It is syntax
B)Can store multiple values
C)Both of above
D)None of above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
9
What is process of defining two or more methods within same class that have same name but different parameters declaration?
A)Method overloading
B)Method overriding
C)Method hiding
D)None of the mentioned
A)Method overloading
B)Method overriding
C)Method hiding
D)None of the mentioned
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
10
Which of these is correct about passing an argument by call-by-value process?
A)Copy of argument is made into the formal parameter of the subroutine.
B)Reference to original argument is passed to formal parameter of the subroutine.
C)Copy of argument is made into the formal parameter of the subroutine and changes made on parameters of subroutine have effect on original argument.
D)Reference to original argument is passed to formal parameter of the subroutine and changes made on parameters of subroutine have effect on original argument.
A)Copy of argument is made into the formal parameter of the subroutine.
B)Reference to original argument is passed to formal parameter of the subroutine.
C)Copy of argument is made into the formal parameter of the subroutine and changes made on parameters of subroutine have effect on original argument.
D)Reference to original argument is passed to formal parameter of the subroutine and changes made on parameters of subroutine have effect on original argument.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
11
What is the process of defining a method in terms of itself that is a method that calls itself?
A)Polymorphism
B)Abstraction
C)Encapsulation
D)Recursion
A)Polymorphism
B)Abstraction
C)Encapsulation
D)Recursion
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
12
Which of the following statements are incorrect?
A)Default constructor is called at the time of declaration of the object if a constructor has not been defined.
B)Constructor can be parameterized.
C)Finalize() method is called when a object goes out of scope and is no longer need
A)Default constructor is called at the time of declaration of the object if a constructor has not been defined.
B)Constructor can be parameterized.
C)Finalize() method is called when a object goes out of scope and is no longer need
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
13
What is the stored in the object obj in following lines of code?
Box obj;
A)Memory address of allocated memory of object.
B)NULL
C)Any arbitrary pointer
D)Garbage
Box obj;
A)Memory address of allocated memory of object.
B)NULL
C)Any arbitrary pointer
D)Garbage
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
14
Which of the following is a valid declaration of an object of class Box?
A)Box obj = new Box();
B)Box obj = new Box;
C)obj = new Box();
D)new Box obj;
A)Box obj = new Box();
B)Box obj = new Box;
C)obj = new Box();
D)new Box obj;
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
15
Which of this statement is incorrect?
A)Every class must contain a main() method.
B)Applets do not require a main() method at all.
C)There can be only one main() method in a program.
D)main() method must be made public.
A)Every class must contain a main() method.
B)Applets do not require a main() method at all.
C)There can be only one main() method in a program.
D)main() method must be made public.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
16
Which of the following statements is correct?
A)Public method is accessible to all other classes in the hierarchy
B)Public method is accessible only to subclasses of its parent class
C)Public method can only be called by object of its class.
D)Public method can be accessed by calling object of the public class.
A)Public method is accessible to all other classes in the hierarchy
B)Public method is accessible only to subclasses of its parent class
C)Public method can only be called by object of its class.
D)Public method can be accessed by calling object of the public class.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
17
Program which executes applet is known as
A)applet engine
B)virtual machine
C)JVM
D)None of above
A)applet engine
B)virtual machine
C)JVM
D)None of above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
18
You read the following statement in a Java program that compiles and executes. submarine.dive(depth); What can you say for sure?
A)Depth must be an int
B)Dive must be a method.
C)Dive must be the name of an instance fie
A)Depth must be an int
B)Dive must be a method.
C)Dive must be the name of an instance fie
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
19
Which is true about an anonymous inner class?
A)It can extend exactly one class and implement exactly one interface.
B)It can extend exactly one class and can implement multiple interfaces.
C)It can implement multiple interfaces regardless of whether it also extends a class.
D)None of above
A)It can extend exactly one class and implement exactly one interface.
B)It can extend exactly one class and can implement multiple interfaces.
C)It can implement multiple interfaces regardless of whether it also extends a class.
D)None of above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
20
If a thread is to be declared as a daemon thread, it must be declared before
A)start method
B)run method
C)stop method
D)None of above
A)start method
B)run method
C)stop method
D)None of above
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck