Java
Java
Q = @ -e.swayam2.ac.in +@® }
Week1 Assesment
The due date for submitting this assignment has passed.
Bue on 2022-10-16, 23:59 IST.
Abstraction
Inheritance
Encapuslation
Polymorphism
2) Which are the features of OOPS describes security of data fram outside of Inference? 7 point
Abstraction
Inheritance
Encapuslation
Polymorphism
3) Output of java compiler is highly optimized set of instructions which is designed to be executed by JVM State true or false? T point
True
False
Yes, the answer is correct.
Accepted Answers:
True
class
Obj
ONE
Yes, the answer is correct
Score: 1
Accepted Answers:
.class
Polymorphism
Abstraction
‘Yes, the answer is correct
Score: 1
Accepted Answers:
Bytecode
6) Which feature supports to invoke the methods across the network? 7 point
JVM
JIT
RMI
JAR
Yes, the answer is correct.
Score: 1
Accepted Answers:
RMI
True
False
Yes, the answer is correct.
Score: 1
Accepted Answers:
False
2
16
4
= O
21:41 “Som AX $99 Heo Sal il 98% ow
3) Output of java compiler is highly optimized set of instructions which is designed to be executed by JVM State true or false? T point
True
False
Yes, the answer is correct.
Score: 1
Accepted Answers:
True
java
class
Obj
BNE
Yes, the answer is correct
Score: 1
Accepted Answers:
class
Inheritance
Bytecode
Polymorphism
Abstraction
Yes, the answer is correct
Score: 1
Accepted Answers:
Bytecode
6) Which feature supports to invoke the methods across the network? 1 paint
JVM
JIT
RMI
JAR
Yes, the answer is correct.
Score: 1
Accepted Answers:
RMI
True
False
Yes, the answer is correct.
ore: 1
Accepted Answers:
False
2
16
4
3
ASCIl
UNICODE
BYTECODE
ENCODE
Yes, the answer is correct.
Score: 1
Accepted Answers:
UNICODE
10) Which kind of variable shared by all the instances of the class? 7 point
Local variable
Global variable
Instance varible
static variable
Yes, the answer is correct.
Score: 1
Accepted Answers:
Static variable
A
I
O
21:43 wom XQ 299 Heo 4Sal wil 98%
® Quiz: Week! Assesment
® Quiz: Week 2 and Week 3 Assesment
Exception Handling, Threads, String, StringTokenizer, Dictionary, System, Hashtables, |O Package and
FileStreams
Event Handling
number of operators
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
number
of operators
2) Modulus operator can be work on float datatype. state true or false? 7 point
tue
false
Yes, the answer is correct.
Score: 1
Accepted Answers:
tue
+
*
aa
f
Yes, the answer is correct
Score: 1
Accepted Answers:
4a
dot operator
arrow operator
instance of
modulus operator
false
tue
Yes, the answer is correct.
Accepted Answers:
tue
c
cH
Java
All the above
Yes, the answer is correct.
Score: 1
Accepted Answers:
Java
7) Changes made on source array does not reflects its cloned array. State true or false? 1 point
tue
false
Yes, the answer is correct
Score: 1
Accepted Answers:
tue
A
I
O
21:43 Som A ae tf o Sil tl 98% Go)
Q = @ -e.swayam2.ac.in + @
3) Find out short circuit operator? 1 point
+
*
aa
f
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
a
arrow operator
instance of
modulus operator
7) Changes made on source array does not reflects its cloned array. State true or false? T point
tue
false
Yes, the answer is correct.
Score: 1
Accepted Answers:
tue
8) Identify the statement that helps the programmer to bypass the current iteration? 1 point
break
goto
continue
loop
9) How do you determine the number of elements in an array given int buses] = new int[5];? 1 point
buses.length
buses.length()
buses.size
buses.size(}
i O
21:50 “om A Os ¥ o Gal tl 97% Go:
true
false
re
>
4
1
3
2
class definition
object
method
data
@
Yes, the answer is correct.
Score: 1
Accepted Answers:
new
overriding
overloading
virtual
class
At run time
At compile time
At coding time
At execution time
oe te ee eee
i O
21:50 “om A 8 Mo a || all 97%
class definition
object
method
date
overriding
overloading
virtual
class
At run time
At compile time
At coding time
At execution time
More than one method with same name but different method signature and different number or type of parameters
More than one method with same name, same signature but different number of signature
More than one method with same name, same signature, same number of parameters but different type
More than one method with same name, same number of parameters and type but different signature
Compile polymorphism
Multiple polymorphism
Multilevel polymorphism
object
class
data
method
Event Handling
Week 6 Assessment
The due date for submitting this assignment has passed.
Due on 2022-10-30, 23:59 IST.
2) A static final variable that is not initialized at the time of declaration is 1 point
static blank final variable
final variable
static variable
blank final variable
Yes, the answer is correct.
Score: 1
Accepted Answers:
static blank fina! variable
3) What will happen during the execution of the following code for the command line input? 1 point
public class CMODemo
{
public static void main(String args|])
{
System.out printin(args[4]};
}
fi
‘Consider the following input on command line.
A. Welcome to My First Program
B. SWAYAM NPTEL Portal
. Welcome to SASTRA Online
D 123
Program
First
Compilation Error
No Output
]
public class Clisntelass
t
public atatic void main(String[] arga)
1
Outer outer = new Outer();
Syatem.out. print (outer.text};
Outer. Inner inner = outer.new Inner():
inner.method_inner(}:
O
21:52 “Som A 928 Heo 4Sal il 97%
Outer. Inner inner = outer.new Inner();
inner.method_inner(}:
5) In Java, a class which inherits the properties of other class is known as: T point
Sub class
Super class
connect
Yes, the answer is correct.
Score: 1
Accepted Answers:
extends
7) Which facility in java is used to control inheritance to different classes and levels2 1 point
Static keyword
Access modifiers like default, public, protected and private
Constructor
Yes, the answer is correct.
Score: 1
Accepted Answers:
Access modifiers like default, public, protected and private
8) What is the maximum number of classes required for the implementation of single inheritance? 1 point
on
wo
4
Yes, the answer is correct.
Score: 1
Accepted Answers:
2
9) To implement Hierarchical inheritance, all the member variables and methods of the classes must be declared as default only. 1 point
False
True
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
False
10) A class member declared as protected in super class becomes member of subclass of which type? T point
Public member
Private member
Protected member
Default member
Yes, the answer is correct.
Score: 1
Accepted Answers:
Private member
FOLLOW US
0oe°9
A
I
O
21:53 “Som XQ 299 Heo Sal tl 96%
QQ @@ceswayam2acin + ©] 3:
® Week 8 : Packages and Interfaces - Problem Scenario with Program Solution
Exception Handling, Threads, String, StringTokenizer, Dictionary, System, Hashtables, |O Package and
FileStreams
Event Handling
Week 7 : Assessment
The due date for submitting this assignment has passed.
Due on 2022-11-06, 23:59 IST.
2) The process of extracting the essential elements of a class without including the background details is called 7 point
Polymorphism
Encapsulation
Inheritance
Abstraction
Yes, the answer is correct.
Accepted Answers:
Abstraction
3) Which of the following access specifier(s) should you choose for the class properties, if youneed to accomplish access restricted to all 1 point
subclass in the same and different packages?
default
public
protected
private
interface
packages
extends
implements
20
Compiletime error
21
Garbage value will be printed
O
21:53 “Som XQ 299 Heo 4Sal wil 96% 7
21
Garbage value will be printed
Garbage value
7) Amethod in a subclass has the same name and type signature as a method in its superclass, then the method in the subclass is called 1 point
method overriding
method overloading
abstract methods
static final methods
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
method overriding
8) Ifa super class reference variable can refer to a subclass object and is called T point
upeasting
method overloading
encapsulation
abstraction
Yes, the answer is correct.
Score: 1
Accepted Answers:
upcasting
abstraction
multilevel inheritance
constructor overloading
method overriding
10) A class that connects an interface must utilize all the variables declared in the interface 1 point
True
False
Yes, the answer is correct.
Score: 1
Accepted Answers:
False
FOLLOW US:
0oe°90
21:55 Som XQ 999 Ho “Sil tl 96%
[OException
NullPointer Exception
NullpointerException
ArrayindexOutOfBoundsException
Land Il Only
Ill Only
Only
getThreadPriority()
getValue()
Yes, the answer is comect.
Score: 1
Accepted Answers:
getPriority()
5) For the program given below, what will be the output after its execution? 7 point
public class Demo
false
Yes, the answer is correct.
‘Score: 7
Accepted Answers:
tue
Wakes up all threads that are not waiting on this object's monitor
ft doesn’t Wake up any thread that are waiting on this object's monitor
i O
21:55 “om XQ 299 Heo 4Sal wil 96% 7
see eer
5) For the program given below, what will be the output after its execution? 1 point
public: class Demo
{
public static void main(String[] args)
{Thread thread = Thread.currentThread(};
System out printin(thread isAlive());
t}
false
Yes, the answer is correct.
Score: 1
Accepted Answers:
tue
Wakes up only one thread among a group of threads that are waiting on this object's monitor
Wakes up all threads that are not waiting on this object's monitor
ft doesn’t Wake up any thread that are waiting on this object's monitor
8) Which of the following package offers all the supportive classes for the exception handling mechanism ? 1 point
java.util
java.io
java.lang
java.awt
private
e i
A
I
O
21:56 Som AQ 9:00 von Sal tl 96%
2) The task of coordinating the execution of processes iin a way that no two processes can have access to the same shared data and T paint
resources is called
Thread Synchronization
3) The mechanism in which a thread is paused running in its critical section and another thread is allowed to enter (or lock) in the same 7 point
critical section to be executed is called
5) Which of the below is a class which utilizes the class String as 4 key to store the value in Object 7 7 point
Dictionary
Properties
Array
StringBuffer
Yes, the answer is correct.
Score: 1
Accepted Answers:
Properties
System.out_printin(s1+" “+s2);
Online degree J
Array
StringBuffer
Yes, the answer is correct.
Score: 1
Accepted Answers:
Properties
‘System.out_printin(s1+" “+s2);
Online degree J
7) What will be the exact output of the following code snippet 7 point
public class Mains
0
No, the answer is incorrect.
Score: 0
Accepted Answers:
4
8) Which of the following method of String class is used to convert alphabets from lower case to upper case? 1 point
boolean lowertoUpper()
String toupper()
String teCaseUpper()
String toUpperCasel)
Yes, the answer is correct.
Score: 1
Accepted Answers:
String toUipperCase()
It belongs to java.util package facility to differentiate numbers, quoted strings, identifiers etc.,
itis an abstract class
Direct known sub class is HashTable
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
Dictionary class is used to break a string inte tokens
A
I
O
21:57 Som DX 192 Yon “Gil wil 96%
Week 10 Assessment_2
The due date for submitting this assignment has passed.
Due on 2022-11-28, 23:59 IST.
2) Which of the following method can be used to store a specified value with a specified key in hash table ? T point
V replace (K key, V value)
Vinsertat(V value: key)
V insert (K Key, V value)
V putt K Key, V value)
Objectinput
FileFitter
Yes, the answer is correct.
Score: 1
Accepted Answers:
Runnable
mkdir)
createdirectory()
newdir()
dir(} list
Yes, the answer is correct.
Score: 1
Accepted Answers:
micdir()
5) Which of the following exception is thrown, when the file is not found? 7 paint
[OException
FileException
FileNotFoundException
FileinputException
7) Which of the following method of the System class supports to display text in multiline?
System.nextLine(}
= O q
21:57 Som XQ 390 von Sal tl 96% ow)
6) Which of the following code is correct? 1 point
7) Which of the following method of the System class supports to display text in multiline ? 1 point
System.nextLine[}
System. lineSeparator()
System. newLine()
System.endi(}
Yes, the answer is correct.
Score: 1
Accepted Answers:
System lineSeparatar()
Two abstract classes of the byte stream family are InputStream and OutputStream
Two abstract classes of the byte stream family are Reader and Writer
Two abstract classes of the character stream family are InputStream and OutputStream
4
Qo
try statement
AutoClosable class
Closeable interface
gc() method of System interface
Yes, the answer is corect.
Score: 1
Accepted Answers:
try statement
MHRD
FOLLOW US
0oe°9o
I
O
21:58 “om A 13.0 vi
tes Meo “Sal tl 96%
o @ ‘e.swayam2.ac.in + @ :
Week 11 assessment 2
The due date for submitting this assignment has passed.
Due on 2022-12-04, 23:59 IST.
4 compiler
Main()
Interpreter
Browser
Yes, the answer is correct.
Score: 1
Accepted Answers:
Main()
Panel
Serviet
Japplet
SQL
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
Panel
Applet
Serviet
Jdbe
Graphics
In the printer
Dimension
Applet
Applet
Servlet
Jdbe
Graphics
Command prompt
Status bar of the applet
No display
In the printer
Color
Graphics
Dimension
Applet
Int
Color
Void
Double
Yes, the answer is correct.
Score: 1
Accepted Answers:
Void
getimaget)
insertimage()
ImageGet(}
loadimagef)
Yes, the answer is correct.
Score: 1
Accepted Answers:
getimaget)
ImageObserver
ImageDetails
ImageStore
ImageGet
Applet
Servlet
Graphics
Image
FOLLOW US.
0e0 8
A
I
O
21:59 “om QA 13.9 Ven -43a1 wl 96%
week 12 assessment 2
The due date for submitting this assignment has passed.
Due on 2022-12-11, 23:59 IST.
Javax.swing
Java.io
Javalabel
Java.net
Yes, the answer is correct.
Score: 1
Accepted Answers:
davax.swing
2
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
4
Component
Windows
Layout
Servlet
Yes, the answer is correct.
Score: 1
Accepted Answers:
Windows
5) Labelis a T point
Active control
Passive control
Interactive control
Monolithic control
Yes, the answer is correct.
Score: 1
Accepted Answers:
Passive control
3
Yes, the answer is correct.
Score: 1
Accepted Answers:
3
3
Yes, the answer is correct.
Score: 1
Accepted Answers:
2
i O
21:59 “om A 0.00
KB/s Hi o Sil tl 96%
3) How many types of containers available in AWT? 1 point
Bow ow
2
Windows
Layout
Servlet
‘Yes, the answer is correct.
Accepted Answers:
Windows
5) Labelis a T point
Active control
Passive conirol
Interactive control
Monolithic control
Yes, the answer is correct.
Score: 1
Accepted Answers:
Passive control
3
Yes, the answer is correct.
Score: 1
Accepted Answers:
3
3
Yes, the answer is correct.
Score: 1
Accepted Answers:
2
7
8
Yes, the answer is correct.
Score: 1
Accepted Answers:
5
25
7
5
6
O
22:00 “\ om AQ 140 von Gil 1 96%
QQ @@ceswayam2acin + ©] 3:
Week 13 Assessment 2?
The due date for submitting this assignment has passed.
Due on 2022-12-18, 23:59 IST.
CardLayout
GridBagLayout
Frame
BorderLayout
FlowLayout
BorderLayout
CardLayot
GridLayout
FlowLayout
BorderLayout
CardLayout
GridBagLayout
enableEvent(}
enable()
enableObject()
enableEventst)
Yes, the answer is correct.
Score: 1
Accepted Answers:
enableEvents()
5) The layout manager that lays out a container's components in a rectangular grid T point
BorderLayout
GridLayout
CardLayout
FlowLayout
java.all.Component
all. awt.Component
java.awt.Component
awt.Component
border layout
panel
grid layout
layout manager
i O d
22:01 “om XQ 299 Heo 4Sal wil 95% 7
None of the above
Yes, the answer is correct.
Score: 1
Accepted Answers:
Returns the item which was clicked and triggered the ttemEvent
4) getClass() T point
Retums the component when its lost focus
5) When the user changes the value of the scrolling component, it receives an instance of 7 point
AdjustmentEvent
FocusEvent
AdjustmentType Event
Permanent , temporary
Permanent, random
Temporary , random
2
3
4
No, the answer is incorrect.
Score: 0
Accepted Answers:
2
Do not change
Explicit focus changes
Both A and B
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
Explicit focus changes
EventListener Object
void
HtemSelectable object
O
22:01 “om A 2.99
¥en 24S al tl 95% ow)
QQ @:eswayam2acin + ©] :
Week 15 Assessment
The due date for submitting this assignment has passed.
Due on 2023-01-02, 23:59 IST.
MouseEvent
ftemEvent
ActionEvent
ltemInterfaceEvent
Yes, the answer is comect.
Score: 1
Accepted Answers:
ttemEvent
Accepted Answers:
Retums the item which was clicked and triggered the (temEvent
4) getClass() 1 point
5) When the user changes the value of the scrolling component, it receives an instance of T paint
AdjustmentEvent
FocusEvent
AdjustmentType Event
Random , optimal
Permanent , temporary
Permanent, random
Temporary , random
i O q
22:00 “om A 3.90 Ven -4Sa1 wl 96% C7
o @ ‘e.swayam2.ac.in +
@
Yes, the answer is correct
Score: 1
Accepted Answers:
java.util
5) Which of these methods are used to register a mouse motion listener? 1 point
addMousef}
addMouseListener()
addMouseMationListner()
eventMouseMotionListener()
ActionEvent
WindowEvent
AdjustmentEvent
7) Which of these methods can be used to obtain the reference to the container that generated a ContainerEvent? 1 point
getContainer()
getActionEvent()
getContainerEvent()
getContainerCommand()
ActionListener
ContainerListener
ComponentListener
9) Which of these methods can be used to determine the type of event? 1 point
getIDi)
getSource(}
getEvent()
getEventObject()
Yes, the answer is correct.
Score: 1
Accepted Answers:
getlD()
10) Which of these events will be generated if we close an applet’s window? 1 point
ActionEvent
ComponentEvent
AdjustmentEvent
WindowEvent
‘Yes, the answer is correct.
Score: 1
Accepted Answers:
WindowEvent
22:00 “om XX %99 Heo 44) il 96% Ga
QQ @@ceswayam2acin + ©] 3:
WEEK 14 ASSESSMENT 2
The due date for submitting this assignment has passed.
Due on 2022-12-25, 23:59 IST.
1) Which of these packages contains all the classes and methods required for even handling in Java? T point
java.applet
java.awt
java.event
java.awt.event
2) Which of these methods are used to register a keyboard event listener? T paint
KeyListener()
addKistener()
addKeyListener()
eventKeyboardListener(}
java.io
java.lang
java.net
java.util
EventObject
EventClass
ActionEvent
ItemEvent
Yes, the answer is correct.
Score: 1
Accepted Answers:
EventObject
5) Which of these methods are used to register a mouse motion listener? T paint
addMause{}
addMouseListener(}
addMouseMationListner()
eventMouseMotionListener()
Accepted Answers:
addMouseMotionListner|)
KeyEvent
ActionEvent
WindowEvent
AdjustmentEvent
Accepted Answers:
ActionEvent
7) Which of these methods can be used to obtain the reference to the container that generated a ContainerEvent? 1 point
getContainer()
getActionEvent()
getContainerEvent()
getContainerCommand()
O
22:00 “om A 0.00
KB/s Hi o Sil tl 96%
FlowLayout
BorderLayout
CardLayout
GridBagLayout
5) The layout manager that lays out a container’s components in a rectangular grid 1 point
BorderLayout
GridLayout
CardLayout
FlowLayout
java.awt.Component
awt.Component
panel
grid layout
layout manager
java.awt.event ActionListener
BorderLayout
GridLayout
Allaf these
Yes, the answer is correct.
Score: 1
Accepted Answers:
All of these
5
Yes, the answer is correct.
Score: 1
Accepted Answers:
a