0% found this document useful (0 votes)
58 views3 pages

Week 2

Uploaded by

onlineservish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views3 pages

Week 2

Uploaded by

onlineservish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

X

[email protected]

(https://swayam.gov.in)

(https://swayam.gov.in/nc_details/NPTEL)

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Programming In Java (course)

If already
registered, click
to check your
Week 02 : Assignment 02
payment status The due date for submitting this assignment has passed.
Due on 2024-02-07, 23:59 IST.

Course outline Assignment submitted on 2024-01-29, 14:50 IST


1) In Java programming an object can take many forms. This feature is called ______. 1 point
About NPTEL
() a. Abstraction
b. Polymorphism
How does an
c. Encapsulation
NPTEL online
course work? d. Inheritance
() Yes, the answer is correct.
Score: 1
Week 0 : () Accepted Answers:
b. Polymorphism
Week 1 : ()
2) Which of the following is a valid declaration of an object of class, say NPTEL? 1 point
Week 2 : ()
a. NPTEL obj = new NPTEL();
Lecture 06 : b. NPTEL obj = new NPTEL;
Demonstration-II
c. obj = new NPTEL();
(unit?
unit=26&lesson= d. new NPTEL obj;
27) Yes, the answer is correct.
Score: 1
Lecture 07 :
Accepted Answers:
Encapsulation
a. NPTEL obj = new NPTEL();
(unit?
unit=26&lesson=
28) 3) A default constructor_______________________ 1 point

Lecture 08 : a. has no arguments


Demonstration-
b. has no return type
III (unit?
unit=26&lesson= c. has one argument but no return type
29) d. has two arguments
Yes, the answer is correct.
Lecture 09 :
Score: 1
Java
Accepted Answers:
Programming
a. has no arguments
Insights (unit?
unit=26&lesson= 4) A top-level class may have which one of the following access modifiers? 1 point
30)
a. package
Lecture 10 :
Demonstration- b. private
IV (unit? c. protected
unit=26&lesson=
d. public
31)
Yes, the answer is correct.
Quiz: Week 02 : Score: 1
Assignment 02
Accepted Answers:
(assessment? d. public
name=295)

Assignment 2 5) Integer in Java is a\an _______. 1 point


Solution (unit?
unit=26&lesson= a. Adapter class
33) b. Inner class
Week 2 c. Not a class
Feedback Form d. Wrapper class
(unit?
unit=26&lesson= Yes, the answer is correct.
32)
Score: 1
Accepted Answers:
Week 3 : () d. Wrapper class

Week 4 : () 6) What is true about the new operator? 1 point

a. returns a pointer to a variable


Week 5 : ()
b. creates a variable called new
Week 6 : () c. obtains memory for a new variable
d. tells how much memory is available
Week 7 : ()
Yes, the answer is correct.
Score: 1
Week 8 : () Accepted Answers:
c. obtains memory for a new variable
Week 9 : ()
7) Which one is not supported by OOP? 1 point
Week 10 : ()
a. Abstraction
Week 11 : () b. Polymorphism
c. Encapsulation
Week 12 : ()
d. Global variables

DOWNLOAD Yes, the answer is correct.


VIDEOS () Score: 1
Accepted Answers:
d. Global variables
Books ()

8) Which of the following modifiers can be used to disallow a method from being overridden? 1 point
Text
Transcripts ()
a. final
b. transient
Problem
Solving c. volatile
Session - Jan d. static
2024 ()
Yes, the answer is correct.
Score: 1
Accepted Answers:
a. final

9) Consider the following code segment 1 point

Identify the line number(s) where there is/are error(s) in the above code.

a. 1
b. 2
c. 3
d. 4 and 5

No, the answer is incorrect.


Score: 0
Accepted Answers:
b. 2

10) Which of the following is TRUE about print() and println() methods? 1 point

a. print() prints in a single line only and multiple lines cannot be printed in any way.
b. println() prints and then appends a line break.
c. println() prints in a single line only and multiple lines cannot be printed.
d. print() prints and then appends a line break.

Yes, the answer is correct.


Score: 1
Accepted Answers:
b. println() prints and then appends a line break.

You might also like