Quizermania Logo

Programming in Java | NPTEL 2022 | Week 2 Assignments Solutions

This article will help you with the solutions of the  Programming in Java NPTEL 2022 Week 2 Assignment .

Programming in Java NPTEL Week 2 Programming Assignment 1 Solutions

Complete the code segment to call the method   print()  of class Student first  and then call  print()   method of class School .

Week 2: Programming Assignment 2 Solution

Complete the code segment  to call the method   print()  of class given class Printer to print the following. ——————————– Hi! I am class STUDENT Hi! I class SCHOOL. ——————————–

Week 2: Programming Assignment 3 Solution

Complete the code segment to call print() method of class Question by creating a method named  ‘studentMethod()’.

Week 2: Programming Assignment 4 Solution

Complete the code segment  to call default constructor first and then any other constructor in the class.

Week 2: Programming Assignment 5 Solution

Complete the code segment to  debug / complete the program which is intended to print ‘NPTEL JAVA’.

The above question set contains all the correct answers. But in any case, you find any typographical, grammatical or any other error in our site then kindly  inform us . Don’t forget to provide the appropriate URL along with error description. So that we can easily correct it.

Thanks in advance.

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.

Related Posts

Html mcq : html basics (multiple choice question), html mcq : html web browsers (multiple choice question).

Preprocessor Directives

C programming MCQ : Preprocessor Directives(MULTIPLE CHOICE QUESTION)

C++ mcq : c++ basics(multiple choice question), leave a comment cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

  • 1st Central Law Reviews: Expert Legal Analysis & Insights
This post is a draft . If you're reading this, you're probably a cool and trusted person. Please don't share it thank you.

Java NPTEL Solutions Week 2: Mastering Advanced Java Challenges

 Java NPTEL Solutions Week 2: Mastering Advanced Java Challenges cover image

In this blog post, we’ll dive deep into the solutions for Week 2 of your Java NPTEL course. These challenges will help you grasp more advanced concepts in Java programming. Let’s tackle each question efficiently while keeping our code clean and concise.

Java Week 2: Q1 - Calling ‘print()’ Using Inner Classes

In this problem, we have an outer class School and an inner class Student . To call the print() method in the Student class, you can create an object of the inner class and use it to invoke the print() method. Here’s the solution:

Explanation: We create an object of the inner class Student using School.Student s1 = new School().new Student(); and then call the print() method on this object.

Java Week 2: Q2 - Calling Methods of Different Classes

In this question, we have two separate classes, School and Student , each with its own print() method. To call these methods, you can create objects of the respective classes and invoke their print() methods. Here’s the solution:

Explanation: We create objects of both the Student and School classes and then call their respective print() methods.

Java Week 2: Q3 - Calling Methods by Creating a New Method

In this question, you need to call the print() method of class Question by creating a method named studentMethod() . Here’s the solution:

Explanation: We create an object of the Question213 class and call the studentMethod() , which in turn calls the print() method of the same class.

Java Week 2: Q4 - Calling Constructors in a Specific Order

This question involves calling constructors in a specific order in the Answer class. We create an object of the Answer class with the appropriate constructor. Here’s the solution:

Explanation: We create an object of the Answer class using the constructor with parameters, which in turn calls the default constructor using this() .

Java Week 2: Q5 - Debugging to Print ‘NPTEL JAVA’

This question requires debugging to print the text ‘NPTEL JAVA.’ Here’s the corrected solution:

Explanation: The code declares and initializes three strings and then prints them concatenated with spaces to get the desired output ‘NPTEL JAVA.’

That wraps up our solutions for Week 2 of your Java NPTEL course. These challenges have introduced you to some advanced Java concepts, including inner classes, method calls, and constructor invocation. Keep practicing and exploring, and you’ll continue to improve your Java programming skills. Stay tuned for more Java NPTEL solutions in the coming weeks!

VTU Updates

Programming in Java NPTEL Assignment Answers of Week 2 (2023)

In this article, you will get NPTEL Assignment Answers of Week 2 (2023) of the course Programming in Java

1. Following is a program given for this question.

What will be the output of the above program?

a. 22221010 b. 12222101 c. 22101010 d. 22221012

Answer:  a. 22221010

2. When an array is passed to a method, what value does the method receive?

a. Reference of the array. b. Copy of the array. c. First element in the array. d. Length of the array.

Answer : a. Reference of the array.

3. Following is a program given for this question.

a. 28 b. -29 c. 30 d. -31

Answer:  c. 30

4. How many bits are needed for float and double in Java, respectively?

a. 32 and 64 b. 32 and 32 c. 64 64 d. 64 and 32

Answer:  a. 32 and 64

5. Which of the following is a valid automatic type conversion in Java?

a. short to byte b. float to long c. int to short d. int to long

Answer:  d. int to long

6. Consider the following program and identify the output.

a. 5 b. 10 c. 50 d. Compilation error

Answer:  d. Compilation error

7. Which of the following is a valid declaration of an object of class say, Student?

a. Student obj = new Student; b. Student obj = new Student(); c. obj = new Student(); d. new Student obj;

Answer:  b. Student obj = new Student();

8. What is the output of the following program?

a. 210 b. 120 c. 012 d. 201

Answer:  c. 012

9. Consider the following piece of code.

Which of the following option is the output of the above program?

a. java b. npteljava c. nptel java d. nptel

Answer:  d. nptel

10. What is the output of the following program?

a. 60 b. 3011 c. 33 d. Compilation error

Programming Assignment Answers

Week 2 : programming assignment 1.

Complete the code segment to call the method   print()  of class School first  and then call  print()   method of class Student .

Week 2 : Programming Assignment 2

Complete the code segment  to call the method   print()  of class given class Printer to print the following.

——————————–

Hi! I am class SCHOOL

Hi! I class STUDENT. ——————————–

Week 2 : Programming Assignment 3

Complete the code segment to call print() method of class Question by creating a method named  ‘student()’.

Week 2 : Programming Assignment 4

Complete the code segment  to call default constructor first and then any other constructor in the class.

Week 2 : Programming Assignment 5

Complete the code segment to  debug / complete the program which is intended to print ‘NPTEL JAVA’.

Related Posts

Explain network layer design issues..

  • April 4, 2024

AngularJS application that displays the date

  • March 12, 2024

AngularJS application to convert student details to Uppercase

Leave a reply cancel reply.

Your email address will not be published. Required fields are marked *

Add Comment  *

Save my name, email, and website in this browser for the next time I comment.

Post Comment

swayam-logo

  • Review Assignment
  • Announcements
  • About the Course
  • Explore Courses

"Programming In Java" - Assignment- 10, Solution Released

Dear Participants,

The  Solutions  of the   Assignment - 10  under   Week - 10  for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/142RZMyBONZQhvwh0D3NpPjM4V_-w2kMl/view

Happy Learning!  Thanks & Regards,

"Programming In Java" - Week 12 - Feedback Form

Dear Learners,

Thank you for enrolling in this NPTEL course and we hope you have gone through the contents for this week and also attempted the assignment.

We value your feedback and wish to know how you found the videos and the questions asked - whether they were easy, difficult, as per your expectations, etc

We shall use this to make the course better and we can also know from the feedback which concepts need more explanation, etc.

Please do spare some time to give your feedback - comprises just 5 questions - should not take more than a minute, but makes a lot of difference for us as we know what the Learners feel.

Here is the link to the form: https://docs.google.com/forms/d/1Dq0G3T4Y_mPZ9-tejAlwOvkwHAmJ8el2nW4BoI681zU/viewform

"Programming In Java" - Week 12 content is live now!!

Dear Students The lecture videos for  Week 12  have been uploaded for the course  "Programming In Java".  The lectures can be accessed using the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=106&lesson=107 The other lectures of this week are accessible from the navigation bar to the left. Please remember to login into the website to view contents (if you aren't logged in already). Assignment 12 for Week 12  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=106&assessment=356 The assignment has to be submitted on or before  Wednesday, 17-04-2024, 23:59 IST. Programming Assignment 1 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=320 Programming Assignment 2 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=335 Programming Assignment 3 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=336 Programming Assignment 4 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=337 Programming Assignment 5 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=338 For all the Programming Assignments due date will be :  Thursday, 18-04-2024, 23:59 IST As we have done so far, please use the discussion forums if you have any questions on this module. Note : Please check the due date of the assignments in the announcement and assignment page if you see any mismatch write to us immediately. Thanks and Regards, --NPTEL Team

Programming In Java : Problem solving Session Preponed!!

Dear learner, Due to unavoidable circumstances, The Problem solving Session organized for (April 09, 2024 - Tuesday)(06.00 PM - 08.00 PM) is Preponed to April 05, 2024 - Friday. We invite you to join the session and get your doubts cleared and learn better. Date: April 05, 2024 - Friday Time: 06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa   Happy Learning. -NPTEL Team

Programming In Java : Assignment 8 question no 7

Dear Students, There is typo mistake in assignment 8 question no 7. Hence the question is not considered for evaluation. The re-evaluation has been done. The updated score is displayed under Progress tab. Sorry for the inconvenience. -NPTEL Team

Programming In Java : Problem solving Session Reminder !!

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: April 02, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

"Programming In Java" - Assignment- 09, Solution Released

The  Solutions  of the   Assignment - 09  under   Week - 09  for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/1Yh_euM0jeeMOX-RSSkEXkSF5i2JH-vaF/view?usp=drive_link

"Programming In Java" - Week 11 - Feedback Form

"programming in java" - week 11 content is live now.

Dear Students The lecture videos for  Week 11  have been uploaded for the course  "Programming In Java".  The lectures can be accessed using the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=98&lesson=99 The other lectures of this week are accessible from the navigation bar to the left. Please remember to login into the website to view contents (if you aren't logged in already). Assignment 11 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=98&assessment=355 The assignment has to be submitted on or before  Wednesday, 10-04-2024, 23:59 IST. Programming Assignment 1 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=343 Programming Assignment 2 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=342 Programming Assignment 3 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=344 Programming Assignment 4 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=345 Programming Assignment 5 for Week 11  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=346 For all the Programming Assignments due date will be :  Thursday, 11-04-2024, 23:59 IST As we have done so far, please use the discussion forums if you have any questions on this module. Note : Please check the due date of the assignments in the announcement and assignment page if you see any mismatch write to us immediately. Thanks and Regards, --NPTEL Team

Survey on Problem Solving sessions - Programming In Java (noc24-cs43)

Dear Learners, We would like to know if the expectations with which you attended this problem solving session are being met and hence please do take 2 minutes to fill out our feedback form. It would help us tremendously in gauging the learner experience. Here is the link to the form:  https://docs.google.com/forms/d/1-Cm5TaFF4z1Qy9euJUhGxrUqxR6kfJUHK-QpMVBNXZw/viewform Problem Solving Session Recording Videos will be uploaded inside the Separate Unit called " Problem solving Session " along with the slides used wherever applicable. Recording sheet :   https://docs.google.com/spreadsheets/d/1veAG77qB7LJ9ARvXMrahGb9PUVXATNkrSE0Ismuqsng/edit -NPTEL Team

Important Notice:No CHANGE in NPTEL Exam Schedule for April 2024

Dear Student,

We wanted to take a moment to address an important matter regarding the upcoming election dates and their potential impact on your exam schedule.

  • None of the election dates clash with scheduled exam dates. If we schedule additional dates, we will ensure they again do not clash with elections in your state. 
  • Hence this is to confirm that there will be no changes to the exam dates and they are the same as previously scheduled. We may have exams in some cities on April 19 and April 26 depending on seat availability on scheduled dates. But again this will be done ensuring we don't conduct exams on election dates in your state. 
  • Your academic progress and success remain our top priority, and we are committed to maintaining the integrity of the examination process.
  • We have more than 6 lakh learners registered for April exams and logistics has been a huge challenge. We understand that some of you may need to travel to your native cities to participate in the voting process. Please remember that you selected your exam cities during registration, and it is crucial that you return to these cities to take your exams as scheduled. Since hall ticket and center allocation is under process, exam cities selected by you during exam registration cannot be changed now. 

Hence we kindly request that you make the necessary arrangements to ensure you can both exercise your right to vote and fulfill your academic obligations.

Warm Regards,

NPTEL Team.

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: March 26, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

"Programming In Java" - Week 10 - Feedback Form

"programming in java" - week 10 content is live now.

Dear Students The lecture videos for  Week 10  have been uploaded for the course  "Programming In Java".  The lectures can be accessed using the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=90&lesson=91 The other lectures of this week are accessible from the navigation bar to the left. Please remember to login into the website to view contents (if you aren't logged in already). Assignment 10 for Week 10  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=90&assessment=354 The assignment has to be submitted on or before  Wednesday, 03-04-2024, 23:59 IST. Programming Assignment 1 for Week 10  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=333 Programming Assignment 2 for Week 10  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=334 Programming Assignment 3 for Week 10  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=339 Programming Assignment 4 for Week 10  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=340 Programming Assignment 5 for Week 10  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=341 For all the Programming Assignments due date will be :  Thursday, 04-04-2024, 23:59 IST As we have done so far, please use the discussion forums if you have any questions on this module. Note : Please check the due date of the assignments in the announcement and assignment page if you see any mismatch write to us immediately. Thanks and Regards, --NPTEL Team

"Programming In Java" - Assignment-8, Solution Released

The  Solutions  of the   Assignment - 08  under   Week - 08  for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/14xmMrI-pGufK8-IAcYblxVGZqzD1B-bx/view?usp=drive_link

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: March 19, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

"Programming In Java" - Assignment-7, Solution Released

The  Solutions  of the   Assignment - 7  under   Week - 7  for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/1n9XM5j0l0NpsbXivmZ9FO-zISvzrqAbM/view?usp=drive_link

"Programming In Java" - Week 9 - Feedback Form

"programming in java" - week 9 content is live now.

Dear Students The lecture videos for Week 9  have been uploaded for the course "Programming In Java". The lectures can be accessed using the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=82&lesson=83 The other lectures of this week are accessible from the navigation bar to the left. Please remember to login into the website to view contents (if you aren't logged in already). Assignment 9 for Week 9  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=82&assessment=352 The assignment has to be submitted on or before Wednesday, 27-03-2024, 23:59 IST. Programming Assignment 1 for Week 9  is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=347 Programming Assignment 2 for Week 9  is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=348 Programming Assignment 3 for Week 9  is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=349 Programming Assignment 4 for Week 9  is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=350 Programming Assignment 5 for Week 9  is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=351 For all the Programming Assignments due date will be : Thursday, 28-03-2024, 23:59 IST As we have done so far, please use the discussion forums if you have any questions on this module. Note : Please check the due date of the assignments in the announcement and assignment page if you see any mismatch write to us immediately. Thanks and Regards, --NPTEL Team

Programming In Java : Assignment 5 question no 4

Dear Students, In assignment 5 question no 4, multiple options are correct. Hence the question is not considered for evaluation. The re-evaluation has been done. The updated score is displayed under Progress tab. Sorry for the inconvenience. -NPTEL Team

Programming In Java : Assignment 5 question no 1

Dear Students, In assignment 5 question no 1, multiple options are correct. Hence the question is not considered for evaluation. The re-evaluation has been done. The updated score is displayed under Progress tab. Sorry for the inconvenience. -NPTEL Team

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: March 12, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

"Programming In Java" - Week 8 content is live now!!

Dear Students

The lecture videos for  Week 8  have been uploaded for the course  "Programming In Java" .  The lectures can be accessed using the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=74&lesson=75

The other lectures of this week are accessible from the navigation bar to the left. Please remember to login into the website to view contents (if you aren't logged in already).

Assignment 8  for  Week 8  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=74&assessment=305

The assignment has to be submitted on or before  Wednesday, 20 - 03 - 2024 ,  23:59 IST .

java week 2 assignment

"Programming In Java" - Assignment-6, Solution Released

The  Solutions  of the   Assignment - 6  under   Week - 6  for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/1gECpqgdTZFkI9xoVKJ-2WEsC0OrceUEk/view?usp=drive_link

"Programming In Java" - Week 8 - Feedback Form

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: March 08, 2024 - Friday Time: 06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: March 05, 2024 - Tuesday Time: 06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa   Happy Learning. -NPTEL Team

"Programming In Java" - Week 7 content is live now!!

The lecture videos for  Week 7  have been uploaded for the course  "Programming In Java" .  The lectures can be accessed using the following link  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=66&lesson=67

Assignment 7  for  Week 7  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=66&assessment=304

The assignment has to be submitted on or before  Wednesday, 13 - 03 - 2024 ,  23:59 IST .

"Programming In Java" - Week 7 - Feedback Form

"programming in java" - assignment-5, solution released.

The  Solutions  of the   Assignment - 5  under   Week - 5  for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/1OVAIeH9RuBl_xDJzFdbZQnbPyOl4cYu8/view?usp=drive_link

"Programming In Java" - Programming Assignments for Week 6 is live now!!

The  Programming  Assignments  for  Week 6  have been uploaded for the course  "Programming In Java"   in the portal and can be accessed using the following links

Please remember to login into the website to view contents (if you aren't logged in already).

Programming  Assignment 1  for  Week  6  is also released and can be accessed from the following link :  https://onlinecourses.nptel.ac.in/noc24_cs43/progassignment?name=307

Programming In Java : Assignment 4 question no 10

Dear Students, There is answer set mistake in assignment 4 question no 10. Hence the question is not considered for evaluation. The re-evaluation has been done. The updated score is displayed under Progress tab. Sorry for the inconvenience. -NPTEL Team

Programming In Java: Assignment 3 question no 5

Dear Students, There is answer set mistake in assignment 3 question no 5. Hence the question is not considered for evaluation. The re-evaluation has been done. The updated score is displayed under Progress tab. Sorry for the inconvenience. -NPTEL Team

Programming In Java : Assignment 4 question no 9

Dear Students, There is typo mistake in assignment 4 question no 9. Hence the question is not considered for evaluation. The re-evaluation has been done. The updated score is displayed under Progress tab. Sorry for the inconvenience. -NPTEL Team

Programming In Java : Problem solving Session Postponed!!

Dear learner, Due to unavoidable circumstances, The Problem solving Session organized Tomorrow (February 27, 2024 - Tuesday)( 06.00 PM - 08.00 PM ) is Postponed to March 04, 2024 - Monday. The G-meet link for the session will be shared before the session. -NPTEL Team

NPTEL: Exam Registration date is extended for 12 week courses of Jan 2024!

  • No further extension will be provided.
  • This extension is only applicable for 12-week courses.

"Programming In Java" - Week 6 - Feedback Form

"programming in java" - assignment-4, solution released.

The  Solutions  of the   Assignment - 4  under   Week - 4  for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/1vnYtLdmy6uBmVUYBQbr_QlsABGeYwrMy/view

"Programming In Java" - Week 6 - content is live now!!

The lecture videos for Week 6 have been uploaded for the course "Programming In Java" . The lectures can be accessed using the following link: https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=58&lesson=59

Assignment - 6 for Week - 6 is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=58&assessment=303

The assignment has to be submitted on or before Wednesday, [06/03/2024 ] , 23:59 IST.

As we have done so far, please use the discussion forums if you have any questions on this module.

Note : Please check the due date of the assignments in the announcement and assignment page if you see any mismatch write to us immediately.

Thanks and Regards,

--NPTEL Team

Reminder: NPTEL: Exam Registration is date is extended for Jan 2024 courses!

Dear Learner,  The exam registration for the Jan 2024 NPTEL course certification exam is extended till February 23, 2024 - 05.00 P.M . CLICK HERE to register for the exam Choose from the Cities where exam will be conducted: Exam Cities Click here to view Timeline and Guideline : Guideline For further details on registration process please refer the previous announcement in the course page. -NPTEL Team

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: Feb 20, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

"Programming In Java" - Week 5 - content is live now!!

The lecture videos for Week 5 have been uploaded for the course "Programming In Java" . The lectures can be accessed using the following link: https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=50&lesson=51

Assignment - 5 for Week - 5 is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=50&assessment=302

The assignment has to be submitted on or before Wednesday, [28/02/2024 ] , 23:59 IST.

"Programming In Java" - Week 5 - Feedback Form

"programming in java" - assignment-3, solution released.

The Solutions of the Assignment - 3 under Week - 3 for the course  "Programming In Java"  has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link:  https://drive.google.com/file/d/1795_GATH0FvFOdt3m53Gsb7OwhdP0VY5/view?usp=drive_link

Happy Learning! Thanks & Regards,

Dear Learner,  The exam registration for the Jan 2024 NPTEL course certification exam is extended till February 20, 2024 - 05.00 P.M . CLICK HERE to register for the exam Choose from the Cities where exam will be conducted: Exam Cities Click here to view Timeline and Guideline : Guideline For further details on registration process please refer the previous announcement in the course page. -NPTEL Team

"Programming In Java" - Week 4 - content is live now!!

The lecture videos for Week 4 have been uploaded for the course "Programming In Java" . The lectures can be accessed using the following link: https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=42&lesson=43

Assignment - 4 for Week -4 is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=42&assessment=297

The assignment has to be submitted on or before Wednesday, [21/02/2024 ] , 23:59 IST.

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: Feb 13, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

"Programming In Java" - Assignment-1 & 2 Solution Released

Dear Learners ,

The  Solutions of  Assignment- 1 & 2  under  Week- 1 & 2   for the course  "Programming In Java"  has been released 

in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link for assignment 1 solution:  https://drive.google.com/file/d/1gjn_KeNy0OzwCQ_9eq_aKC2xyfwR5-f6/view?usp=drive_link

Link for assignment 2 solution:  https://drive.google.com/file/d/1dryqNToKKQuNAtgF-EC5hx-Vc6oEdmQO/view?usp=drive_link

Happy Learning!

Thanks & Regards,

"Programming In Java" - Week 4 - Feedback Form

Feedback on nptel translation and transcripts.

Dear Learners, Do you find English difficult to follow in the NPTEL course? Would it be easier and help you if the videos had subtitles in Indian languages? We have great news for you! The videos in this course have been translated into Kannada Language But how do you change the subtitles? Follow the steps below. To watch the video having subtitles in regional language: 1. Click on the lecture under Week contents. 2. Play the video. 3. Now click on the Settings icon and a list of features will display 4. From that select the option Subtitles/CC. 5. Now select the Language from the available languages to read the subtitle in the regional language. Try this out and give us feedback! Let us know if you want more of this! https://forms.gle/i4muUY4F2NU7EzLr6 -NPTEL Team

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: Feb 06, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

Programming In Java - Problem Solving Session Recording is available!!

Dear Learner, We have uploaded the Recorded videos of the Live Interaction Session - Problem solving Session of Week 1 . Videos are uploaded inside the Separate Unit called " Problem solving Session " along with the slides used wherever applicable. Login to the course on swayam.gov.in to check the same. -NPTEL Team

"Programming In Java" - Week 3 - content is live now!!

The lecture videos for Week 3 have been uploaded for the course "Programming In Java" . The lectures can be accessed using the following link: https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=34&lesson=35

Assignment - 3 for Week -3 is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=34&assessment=296

The assignment has to be submitted on or before Wednesday, [14/02/2024 ] , 23:59 IST.

"Programming In Java" - Week 3 - Feedback Form

java week 2 assignment

Reminder: NPTEL: Exam Registration is open now for Jan 2024 courses!

Dear Learner, 

Here is the much-awaited announcement on registering for the Jan 2024 NPTEL course certification exam. 

1. The registration for the certification exam is open only to those learners who have enrolled in the course. 

2. If you want to register for the exam for this course, login here using the same email id which you had used to enroll to the course in Swayam portal. Please note that Assignments submitted through the exam registered email id ALONE will be taken into consideration towards final consolidated score & certification. 

3 . Date of exam: Apr 27, 2024 

CLICK HERE to register for the exam.

Choose from the Cities where exam will be conducted: Exam Cities

4. Exam fees: 

If you register for the exam and pay before Feb 12, 2024 - 5:00 PM, Exam fees will be Rs. 1000/- per exam .

5. 50% fee waiver for the following categories: 

Students belonging to the SC/ST category: please select Yes for the SC/ST option and upload the correct Community certificate.

Students belonging to the PwD category with more than 40% disability: please select Yes for the option and upload the relevant Disability certificate. 

6. Last date for exam registration: Feb 16, 2024 - 5:00 PM (Friday). 

7. Between Feb 12, 2024 - 5:00 PM & Feb 16, 2024 - 5:00 PM late fee will be applicable.

8. Mode of payment: Online payment - debit card/credit card/net banking/UPI. 

9. HALL TICKET: 

The hall ticket will be available for download tentatively by 2 weeks prior to the exam date. We will confirm the same through an announcement once it is published. 

10. FOR CANDIDATES WHO WOULD LIKE TO WRITE MORE THAN 1 COURSE EXAM:- you can add or delete courses and pay separately – till the date when the exam form closes. Same day of exam – you can write exams for 2 courses in the 2 sessions. Same exam center will be allocated for both the sessions. 

11. Data changes: 

Last date for data changes: Feb 16, 2024 - 5:00 PM :  

We will charge an additional fee of Rs. 200 to make any changes related to name, DOB, photo, signature, SC/ST and PWD certificates after the last date of data changes.

The following 6 fields can be changed (until the form closes) ONLY when there are NO courses in the course cart. And you will be able to edit those fields only if you: - 

REMOVE unpaid courses from the cart And/or - CANCEL paid courses 

1. Do you come under the SC/ST category? * 

2. SC/ST Proof 

3. Are you a person with disabilities? * 

4. Are you a person with disabilities above 40%? 

5. Disabilities Proof 

6. What is your role? 

Note: Once you remove or cancel a course, you will be able to edit these fields immediately. 

But, for cancelled courses, refund of fees will be initiated only after 2 weeks. 

12. LAST DATE FOR CANCELLING EXAMS and getting a refund: Feb 16, 2024 - 5:00 PM  

13. Click here to view Timeline and Guideline : Guideline

Domain Certification

Domain Certification helps learners to gain expertise in a specific Area/Domain. This can be helpful for learners who wish to work in a particular area as part of their job or research or for those appearing for some competitive exam or becoming job ready or specialising in an area of study.  

Every domain will comprise Core courses and Elective courses. Once a learner completes the requisite courses as per the mentioned criteria, you will receive a Domain Certificate showcasing your scores and the domain of expertise. Kindly refer to the following link for the list of courses available under each domain: https://nptel.ac.in/domains

Outside India Candidates

Candidates who are residing outside India may also fill the exam form and pay the fees. Mode of exam and other details will be communicated to you separately.

Thanks & Regards, 

Dear learners, There will be a live interactive session where a Course team member will explain some sample problems, how they are solved - that will help you solve the weekly assignments. We invite you to join the session and get your doubts cleared and learn better. Date: Jan 30, 2024 - Tuesday Time:06.00 PM - 08.00 PM Link to join: https://meet.google.com/eix-ymxs-owa Happy Learning. -NPTEL Team

"Programming In Java" - Assignment-0. Solution Released

The Solution of Assignment - 0 under Week - 0 for the course "Programming In Java " has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

Link: https://drive.google.com/file/d/1l7O2FKZDgX-OZfhzRkyZFU1LEnJJbW3k/view

"Programming In Java" - Week 2 - Feedback Form

"programming in java" - week 2 - content is live now.

The lecture videos for Week 2 have been uploaded for the course "Programming In Java" . The lectures can be accessed using the following link: https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=26&lesson=27

Assignment - 2 for Week -2 is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=26&assessment=295

The assignment has to be submitted on or before Wednesday, [07/02/2024 ] , 23:59 IST.

"Programming In Java" - Download video links are available now!!

The download video link for the course "Programming In Java" is available now in the course outline. Please check the download video link: https://nptel.ac.in/courses/106105191

-NPTEL Team

Programming In Java - Week 1 assignment is live now!!

The A ssignment 1 for Week 1 for the course " Programming In Java " is made available now.

Assignment 1 can be accessed using the this link : https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=18&assessment=298

The other Assignment 1 is accessible from the navigation bar to the left under Week 1. Please remember to login into the website to view contents (if you aren't logged in already).

The assignment has to be submitted on or before Wednesday, 7th Feb 2024 , 23:59 IST.

Please use the discussion forums if you have any questions on this module.

"Programming In Java" - Week 1 - Feedback Form

"programming in java" - week 1 - content is live now.

The lecture videos for Week 1 have been uploaded for the course "Programming In Java" . The lectures can be accessed using the following link: https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=18&lesson=19

Assignment - 1 for Week -1 is also released and can be accessed from the following link : https://onlinecourses.nptel.ac.in/noc24_cs43/unit?unit=18&assessment=294

"Programming In Java" - Assignment-0-RELEASED

We welcome you all to this course. The Assignment 0 for the course  "Programming In Java "   has been released. This assignment is based on a prerequisite of the course. Kindly note that marks obtained in this assignment will not be considered for the final assessment. You can find the assignment under Week 0 unit on the left-hand side of your screen. You can submit the assignment multiple times. All the best !!    

NPTEL: Exam Registration is open now for Jan 2024 courses!

Programming in java: welcome to nptel online course - jan 2024.

  • Every week, about 2.5 to 4 hours of videos containing content by the Course instructor will be released along with an assignment based on this. Please watch the lectures, follow the course regularly and submit all assessments and assignments before the due date. Your regular participation is vital for learning and doing well in the course. This will be done week on week through the duration of the course.
  • Please do the assignments yourself and even if you take help, kindly try to learn from it. These assignments will help you prepare for the final exams. Plagiarism and violating the Honor Code will be taken very seriously if detected during the submission of assignments.
  • The announcement group - will only have messages from course instructors and teaching assistants - regarding the lessons, assignments, exam registration, hall tickets, etc.
  • The discussion forum (Ask a question tab on the portal) - is for everyone to ask questions and interact. Anyone who knows the answers can reply to anyone's post and the course instructor/TA will also respond to your queries.
  • Please make maximum use of this feature as this will help you learn much better.
  • If you have any questions regarding the exam, registration, hall tickets, results, queries related to the technical content in the lectures, any doubts in the assignments, etc can be posted in the forum section
  • The course is free to enroll and learn from. But if you want a certificate, you have to register and write the proctored exam conducted by us in person at any of the designated exam centres.
  • The exam is optional for a fee of Rs 1000/- (Rupees one thousand only).
  • Date and Time of Exams: April 27, 2024 Morning session 9am to 12 noon; Afternoon Session 2 pm to 5 pm.
  • Registration URL: Announcements will be made when the registration form is open for registrations.
  • The online registration form has to be filled and the certification exam fee needs to be paid. More details will be made available when the exam registration form is published. If there are any changes, it will be mentioned then.
  • Please check the form for more details on the cities where the exams will be held, the conditions you agree to when you fill the form etc.
  • Once again, thanks for your interest in our online courses and certification. Happy learning.

A project of

java week 2 assignment

In association with

java week 2 assignment

  • Sunday, April 7, 2024

NPTEL Programming in Java Week 2 Assignment Solution 2023

Programming-In-Java-Week2-Programming-Assignment-Solutions

NPTEL Programming in Java Week 2 All Programming Assignment Solutions – July 2022 | Swayam. With the growth of Information and Communication Technology, there is a need to develop large and complex software.

Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust. To meet this requirement object-oriented paradigm has been developed and based on this paradigm the Java programming language emerges as the best programming environment.

Now, Java programming language is being used for mobile programming, Internet programming, and many other applications compatible to distributed systems.

This course aims to cover the essential topics of Java programming so that the participants can improve their skills to cope with the current demand of IT industries and solve many problems in their own filed of studies.

COURSE LAYOUT

  • Week 1 : Overview of Object-Oriented Programming and Java
  • Week 2 : Java Programming Elements
  • Week 3 : Input-Output Handling in Java
  • Week 4 : Encapsulation
  • Week 5 : Inheritance
  • Week 6 : Exception Handling
  • Week 7 : Multithreaded Programming
  • Week 8 : Java Applets and Servlets
  • Week 9 : Java Swing and Abstract Windowing Toolkit (AWT)
  • Week 10 : Networking with Java
  • Week 11: Java Object Database Connectivity (ODBC)
  • Week 12: Interface and Packages for Software Development

Course Name : “Programming in Java 2023”

Question : 1   Complete the code segment to call the method   print()  of class School first  and then call  print()   method of class Student .

Question : 2 Complete the code segment  to call the method   print()  of class given class Printer to print the following.

——————————–

Question : 3 Complete the code segment to   call print() method of class Question by creating a method named  ‘student()’.

Question : 4 Complete the code segment  to call default constructor first and then any other constructor in the class.

Question : 5 Complete the code segment to  debug / complete the program which is intended to print ‘NPTEL JAVA’.

Programming In Java | Week 2

Session: JAN-APR 2024

Course name: Programming In Java

Course Link: Click Here

For answers or latest updates join our telegram channel: Click here to join

These are NPTEL Programming In Java Week 2 Assignment 2 Answers

Q1. In Java programming an object can take many forms. This feature is called _______ . a. Abstraction b. Polymorphism c. Encapsulation d. Inheritance

Answer: b. Polymorphism

Q2. Which of the following is a valid declaration of an object of class, say NPTEL? a. NPTEL obj = new NPTEL(); b. NPTEL obj = new NPTEL; c. obj = new NPTEL(); d. new NPTEL obj;

Answer: a. NPTEL obj = new NPTEL();

Q3. A default constructor_______________________. a. has no arguments b. has no return type c. has one argument but no return type d. has two arguments

Answer: a. has no arguments

Q4. A top-level class may have which one of the following access modifiers? a. package b. private c. protected d. public

Answer: d. public

Q5. Integer in Java is a\an __________. a. Adapter class b. Inner class c. Not a class d. Wrapper class

Answer: d. Wrapper class

Q6. What is true about the new operator? a. returns a pointer to a variable b. creates a variable called new c. obtains memory for a new variable d. tells how much memory is available

Answer: c. obtains memory for a new variable

Q7. Which one is not supported by OOP? a. Abstraction b. Polymorphism c. Encapsulation d. Global variables

Answer: d. Global variables

Q8. Which of the following modifiers can be used to disallow a method from being overridden? a. final b. transient c. volatile d. static

Answer: a. final

Q9. Consider the following code segment 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

Answer: b. 2

Q10. Which of the following is TRUE about print() and println() methods? 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.

Answer: b. println() prints and then appends a line break.

More Weeks of Programming In Java: Click here

More Nptel Courses: https://progiez.com/nptel-assignment-answers

Session: JULY-DEC 2023

Course Name: Programming In Java

Programming Assignment

Question 1 Complete the code segment to call the method print() of class Student first and then call print() method of class School.

Question 2 Complete the code segment to call the method print() of class given class Printer to print the following. ——————————– Hi! I am class STUDENT Hi! I class SCHOOL. ——————————–

Question 3 Complete the code segment to call print() method of class Question by creating a method named ‘studentMethod()’.

Question 4 Complete the code segment to call default constructor first and then any other constructor in the class.

Question 5 Complete the code segment to debug / complete the program which is intended to print ‘NPTEL JAVA’.

More Nptel Courses: Click here

Session: JAN-APR 2023

Course Name: Programming in Java

Week 3: Click Here

Q1. Following is a program given for this question. What will be the output of the above program? a. 22221010 b. 12222101 c. 22101010 d. 22221012

Answer: a. 22221010

Q2. When an array is passed to a method, what value does the method receive? a. Reference of the array. b. Copy of the array. c. First element in the array. d. Length of the array.

Answer: a. Reference of the array.

Q3. Following is a program given for this question. What will be the output of the above program? a. 28 b. -29 c. 30 d. -31

Answer: c. 30

Q4. How many bits are needed for float and double in Java, respectively? a. 32 and 64 b. 32 and 32 c. 64 and 64 d. 64 and 32

Answer: a. 32 and 64

Q5. Which of the following is a valid automatic type conversion in Java? a. short to byte b. float to long c. int to short d. int to long

Answer: d. int to long

Q6. Consider the following program and identify the output. a. 5 b. 10 c. 50 d. Compilation error

Answer: d. Compilation error

Q7. Which of the following is a valid declaration of an object of class say, Student? a. Student obj = new Student; b. Student obj = new Student(); c. obj = new Student(); d. new Student obj;

Answer: b. Student obj = new Student();

Q8. What is the output of the following program? a. 210 b. 120 c. 012 d. 201

Answer: c. 012

Q9. Consider the following piece of code. Which of the following option is the output of the above program? a. java b. npteljava c. nptel java d. nptel

Answer: d. nptel

Q10. What is the output of the following program? a. 60 b. 3011 c. 33 d. Compilation error

Programming In Java Programming Assignment Solution

Complete the code segment to call the method print() of class School first and then call print() method of class Student.

Complete the code segment to call the method print() of class given class Printer to print the following. ——————————– Hi! I am class SCHOOL Hi! I class STUDENT. ——————————–

Complete the code segment tocall print() method of class Question by creating a method named ‘student()’.

Complete the code segment to call default constructor first and then any other constructor in the class.

Complete the code segment to debug / complete the program which is intended to print ‘NPTEL JAVA’.

More Weeks of Programming In Java: Click Here

Session: JULY-DEC 2022

Q1. What is the output of the following program?

a) 88 b) 8010 c) 64 d) 810

Answer: c) 64

Q2. Which of the following is generate API documentation in HTML format from Java source code?

a) javac b) javadoc c) javap d) java

Answer: b) javadoc

Q3. Following is a program given for this question.

What will be the output of the above program?

a) javanptel b) npteljava c) janjavanptel d) jannpteljava

Answer: b) npteljava

Q4. What will happen during the execution of the following code for the command line input?

Consider the following input on command line and select the options with the correct output(s).

Input: A: “jan java nptel” B:  1 2 3

a) A : jannptel javanptel nptelnptel b) A : jan java nptel jan java nptel c) B : 11 21 31 d) B : 1 2 3 1

Answer: b), c)

Q5. Which of the following is/are TRUE about print() and println() methods?

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

Answer: d) println() prints and then appends a line break.

Q6. What was the initial name of Java when it was first developed for embedded systems?

a) Greentalk b) Oak c) Java d) Javac

Answer: a) Greentalk

Q7. Which of the following is a valid declaration of an object of class, say Foo?

a) Foo obj = new Foo; b) obj = new Foo(); c) Foo obj = new Foo(); d) new Foo obj;

Answer: c) Foo obj = new Foo();

Q8. Following is a program given for this question.

a) 0 b) 1 c) false d) true

Answer: c) false

Q9. Which of the following can be used to take input from user during the execution of a program?

a) Using the string array provided as a parameter to the main method. b) getText() method can be used to get user input from the command line. c) Scanner class can be used by passing the predefined object System.in d) Once the execution starts, there is no way to provide user input.

Answer: c) Scanner class can be used by passing the predefined object System.in

Q10. What is the output of the following program?

a) 14 b) 12 c) 15 d) 17

Answer: d) 17

Programming in Java NPTEL Week 2 Programming Assignment Solutions

Q1. Complete the code segment to call the method print() of class Student first and then call print() method of class School.

Q2. Complete the code segment to call the method print() of class given class Printer to print the following. ——————————– Hi! I am class STUDENT Hi! I class SCHOOL. ——————————–

Q3. Complete the code segment tocall print() method of class Question by creating a method named ‘studentMethod()’.

Q4. Complete the code segment to call default constructor first and then any other constructor in the class.

Q5. Complete the code segment to debug / complete the program which is intended to print ‘NPTEL JAVA’.

These are NPTEL Programming In Java Week 2 Assignment 2 Answers

Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

Promineo Tech intro to java week 2 coding assignment (conditions and loops)

cruz-gonzalez/Java-Week-2-Coding-Assignment

Folders and files, repository files navigation, java-week-2-coding-assignment.

  • Java 100.0%

NPTEL Programming In Java Assignment 2 Answers July 2023

NPTEL Programming In Java Assignment 2 Answers July 2023:-  All the Answers are provided here to help the students as a reference, You must submit your assignment at your own knowledge

NPTEL Programming In Java Week 2 Assignment Answers 2023

1. Consider the following code segment: 1 class Question{ 2 public static void main(String args){ 3. System.out.print(“Welcome to NPTEL”); 4. } 5. } Identify the numbers where there is/are error(s) in the above code. a. 1 b. 2 c. 3 d. 4 and 5

2. Consider the following code segment: 1 class Question{ 2 public static void main(String[] param 0{ 3 System.out.print(“Welcome to NPTEL”);)) 4 } 5 } Identify the numbers where there is/are error(s) in the above code. a. 1 b. 2 c. 3 d. 4 and 5

3. Consider the following code segment: 1 class Question{ 2 public static void main(String args[]) { 3. for(int n=1; n<=10; n++){ 4. system.out.print(n+” “); 5. } 6. } 7. } Select the correct output description for the above code. a. Prints first n natural numbers in a single line. b. Prints first n natural numbers, one number in a single line. c. Prints first 10 natural numbers in a single line. d. Prints first 10 natural numbers in a single line with no spaces.

4. Consider the following code segment: 1 class Question{ 2 public static void main(String args[]) { 3. for(int n=1; n<=10; n++){ 4. system.out.print(n+” “); 5. } 6. } 7. } Modify the above code such that it prints all the even numbers till 100. a. Replace line 3 with for (int n=2; n<=100; n++){ b. Replace line 3 with for (int n=2; n<=100; n+=2){ c. Replace line 4 with system.out.print(++n + ” “); d. Both option a and c.

5. Following is a program given for this question.

NPTEL Programming In Java Assignment 2 Answers July 2023

What will be the output of the above program? a. 22221018 b. 22222018 c. 22101018 d. 22221218

6. Consider the following incorrect program. 1 public class Question 2 public static void main (String[] args) { 3. short x = 10; 4. x = x * 5; 5. System.out.print (x); 6. } 7. } How to correct the above code segment? a. Change line 4 as x = (short) (x * 5); b. Change line 4 as x = (short) x * 5; c. Change line 4 as x = (short) x * (short) 5; d. Change line 4 as (short) x = x * 5;

7. What will be the output of the above program?

NPTEL Programming In Java Assignment 2 Answers July 2023

a. 210 b. 120 c. 012 d. 000

8. Consider the following piece of code. public class Question! public static void main (String[] args) { String str = “anpotdelqjpava”; System.out.printin(str.substring (1, 3) +str.substring (4, 5) + str.substring (6, 8)); Which of the following option is the output of the above program? a. java b. nptel java c. nptel java d. nptel

9. What is the output of the following program? public class Main{ public void static main (string args []) { char a = ‘a int b = 20; System.out.printin (a+b); } } a. 60 b. 117 c. 33 d. Compilation error

10. Consider the following program. public class Question public static void main (String[] args) { int x = 5; x *= (2 + 8) ; System.out.printin (x) ; } } What will be the output of the program if it is executed? a. 50 b. 10 c. Compiler error d. 5

NPTEL Programming In Java Week 2 Programming Assignment Answers

1. Complete the code segment to call the method   print()  of class Student first  and then call  print()   method of class School .

2. Complete the code segment  to call the method   print()  of class given class Printer to print the following.

——————————–

Hi! I am class STUDENT

Hi! I class SCHOOL. ——————————–

3. Complete the code segment to call print() method of class Question by creating a method named  ‘studentMethod()’.

4. Complete the code segment  to call default constructor first and then any other constructor in the class.

5. Complete the code segment to  debug / complete the program which is intended to print ‘NPTEL JAVA’.

NPTEL Programming In Java Assignment 2 Answers [July 2022]

1. What is the output of the following program?

2. Which of the following is generate API documentation in HTML format from Java source code? a. javac b. javadoc c. javap d. java

Answers will be Uploaded Shortly and it will be Notified on Telegram, So  JOIN NOW

NPTEL Programming In Java Assignment 2 Answers July 2023

3. Following is a program given for this question. What will be the output of the above program? a. javanptel b. npteljava c. janjavanptel d. jannpteljava

4. What will happen during the execution of the following code for the command line input? Consider the following input on command line and select the options with the correct output(s). nput: A: “jan java nptel” B: 123 a. A: jannptel javanptel1 nptelnptel b. A:jan java nptel jan java nptel c. B: 11 21 31 d. B: 1231

5. Which of the following is/are TRUE about print) and println) methods? a. print () prints in a single line only and multiple lines cannot be printed in any way. b. print () prints and then appends a line break. c. println () prints in a single line only and multiple lines cannot be printed. d. println () prints and then appends a line break.

6. What was the initial name of Java when it was first developed for embedded systems? a. Greentalk b. Oak c. Java d. Javac

👇 For Week 03 Assignment Answers 👇

7. Which of the following is a valid declaration of an object of class, say Foo? a. Foo obj = new Foo; b. obj = new Foo(); c. Foo obj = new Fool; d. new Foo obj;

8. Following is a program given for this question. What will be the output of the above program? a. 0 b. 1 c. false d. true

9. Which of the following can be used to take input from user during the execution of a program? a. Using the string array provided as a parameter to the main method. b. getText() method can be used to get user input from the command line. c. Scanner class can be used by passing the predefined object System.in d. Once the execution starts, there is no way to provide user input.

10. What is the output of the following program? a 14 b. 12 c. 15 d. 17

Programming Assignment Answers

Q1. Complete the code segment to call the method  print()  of class Student first  and then call print()  method of class School . Code:-

Q2. Complete the code segment  to call the method   print()  of class given class Printer to print the following. Code:-

Q3. Complete the code segment to call print() method of class Question by creating a method named  ‘studentMethod()’. Code:-

Q4. Complete the code segment  to call default constructor first and then any other constructor in the class. Code:-

Q5. Complete the code segment to debug / complete the program which is intended to print ‘NPTEL JAVA’. Code:-

Disclaimer :- We do not claim 100% surety of solutions, these solutions are based on our sole expertise, and by using posting these answers we are simply looking to help students as a reference, so we urge do your assignment on your own.

For More NPTEL Answers:-  CLICK HERE

Join Our Telegram:-  CLICK HERE

What is Programming In Java?

With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust. To meet this requirement object-oriented paradigm has been developed and based on this paradigm the Java programming language emerges as the best programming environment. Now, Java programming language is being used for mobile programming, Internet programming, and many other applications compatible to distributed systems. This course aims to cover the essential topics of Java programming so that the participants can improve their skills to cope with the current demand of IT industries and solve many problems in their own filed of studies.

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of the average of best 8 assignments out of the total 12 assignments given in the course. Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF THE AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

Below you can find the answers for NPTEL Programming In Java Assignment 2

NPTEL Programming In Java Assignment 2 Answers [Jan 2022]

Q1. Complete the code segment to call the method  print() of class Student first and then call print() method of class School .

Programming In Java Assignment 1 Answers 2022

Q2. Complete the code segment to call the method  print() of class given class Printer to print the following.

Q3. Complete the code segment to call print() method of class Question by creating a method named ‘studentMethod()’.

Q4. Complete the code segment to call default constructor first and then any other constructor in the class.

Q5. Complete the code segment to debug / complete the program which is intended to print ‘NPTEL JAVA’.

Programming In Java Assignment 2 Answers 2022:-  All the Answers provided here to help the students as a reference, You must submit your assignment at your own knowledge

If you found this article Interesting and helpful, don’t forget to share it with your friends to get this information.

Leave a Comment Cancel reply

You must be logged in to post a comment.

Spread the word.

Share the link on social media.

Confirm Password *

Username or email *

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Sorry, you do not have permission to ask a question, You must login to ask a question.

SIKSHAPATH Logo

SIKSHAPATH Latest Articles

Nptel programming in java week 2 assignment answers 2023.

NPTEL Programming in Java Week 2 Assignment Answers 2023

Excited for NPTEL’s Java programming week 2 quiz assignment answers?

Look no further! I’ve got you covered with probable answers for all 10 questions. Use these as a helpful guide in completing your assignment with confidence before the deadline.

Table of Contents

NPTEL Programming in Java Week 2 Assignment Answers

Q1. Following is a program given for this question.

What will be the output of the above program?

Answer: a. 22221010

1000+ subscribers getting help from instant notifications, Join us on telegram.

Q2. When an array is passed to a method, what value does the method receive?

Answer : a. Reference of the array.

Q3. Following is a program given for this question.

Answer: c. 30

Q4. How many bits are needed for float and double in Java, respectively?

Answer: a. 32 and 64

Q5. Which of the following is a valid automatic type conversion in Java?

Answer: d. int to long

Q6. Consider the following program and identify the output.

Answer: d. Compilation error

Q7. Which of the following is a valid declaration of an object of class say, Student?

Answer: b. Student obj = new Student();

Q8. What is the output of the following program?

Answer: c. 012

Q9. Consider the following piece of code.

Which of the following option is the output of the above program?

Answer: d. nptel

Q10. What is the output of the following program?

Programming Answers to Java Assignment

Q1. Complete the code segment to call the method  print()  of class School first  and then call print()  method of class Student .

Disclaimer: These answers are intended only as reference material. No guarantee of accuracy is made. It is strongly recommended to complete the assignment independently.

Also Available:

NPTEL Programming in Java Week 1 Assignment Answers

NPTEL Programming In Java Week 3 Assignment Answers

Related Posts

NPTEL Cloud Computing Assignment 3 Answers 2023

NPTEL Cloud Computing Assignment 3 Answers 2023

NPTEL Problem Solving Through Programming In C Week 1 & 2 Assignment Answers 2023

NPTEL Problem Solving Through Programming In C Week 1 & ...

NPTEL Programming In Java Week 6 Assignment Answers 2023

NPTEL Programming In Java Week 6 Assignment Answers 2023

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

  • Amazon Quiz
  • Flipkart Quiz
  • Play & Win 50,000 Coins
  • Privacy Policy

NPTEL Programming In Java Assignment 2 Answers 2022

  • by QuizXp Team
  • January 30, 2022 February 22, 2022

NPTEL Programming In Java Assignment 2

Are you looking for the Answers to NPTEL Programming In Java Assignment 2? This article will help you with the answer to the  Nation al Programme on Technology Enhanced Learning  ( NPTEL )  Course ” NPTEL Programming In Java Assignment 2 “

What is Programming In Java?

With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust. To meet this requirement object-oriented paradigm has been developed and based on this paradigm the Java programming language emerges as the best programming environment. Now, Java programming language is being used for mobile programming, Internet programming, and many other applications compatible to distributed systems. This course aims to cover the essential topics of Java programming so that the participants can improve their skills to cope with the current demand of IT industries and solve many problems in their own filed of studies.

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of the average of best 8 assignments out of the total 12 assignments given in the course. Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF THE AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

Below you can find the answers for NPTEL Programming In Java Assignment 2

NPTEL Programming In Java Assignment 2 Answers:-

Q1. Complete the code segment to call the method  print() of class Student first and then call print() method of class School .

Q2. Complete the code segment to call the method  print() of class given class Printer to print the following.

Programming In Java Assignment 1 Answers 2022

???? Next Week Answers: Assignment 03 ????

quizxp telegram

Q3. Complete the code segment to call print() method of class Question by creating a method named ‘studentMethod()’.

Salesforce off campus Drive 2022 | Intern | Any Graduate | Bangalore/Hyderabad

Q4. Complete the code segment to call default constructor first and then any other constructor in the class.

Q5. Complete the code segment to debug / complete the program which is intended to print ‘NPTEL JAVA’.

For other courses answers:- Visit

For Internship and job updates:- Visit

Disclaimer: We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.

if you have any suggestions then comment below or contact us at  [email protected]

If you found this article Interesting and helpful, don’t forget to share it with your friends to get this information.

x

' src=

  • All Courses
  • Privacy Policy

' src=

Swayam Solver

Learn Programming & Prepare for NPTEL Exams... Swayam Solver is your one-stop destination for NPTEL exam preparation.

NPTEL Programming in Java Jan 2024 Week 11

Week 11 : programming assignment 1, week 11 : programming assignment 2.

Write the JDBC codes needed to create a Connection interface using the   DriverManager   class and the variable   DB_URL .  Check whether the connection is successful using   ' isAlive(timeout) '   method to generate the output, which is either 'true' or 'false'.

  Note the following points carefully:

§   Name the connection object as   conn   only.

§   Use timeout value as 1.

Week 11 : Programming Assignment 3

Due to some mistakes in the below code, the code is not compiled/executable.

Modify and debug the JDBC code to make it execute successfully.

Week 11 : Programming Assignment 4

Complete the code segment  to create a new table named ‘ STUDENTS’  in SQL database using the following information.

Week 11 : Programming Assignment 5

Complete the code segment  to rename an already created table named ‘ STUDENTS’   into ‘ GRADUATES ’.

No comments:

Post a comment.

Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.

IMAGES

  1. NPTEL Programming In Java Week 2 Assignment Solution

    java week 2 assignment

  2. Programming In Java

    java week 2 assignment

  3. NPTEL Programming In Java WEEK 2 Programming Assignment Solutions

    java week 2 assignment

  4. NPTEL Programming in Java week 2 all 5 programming assignment answer

    java week 2 assignment

  5. NPTEL Programming in Java Week 2 Programming Assignment Solutions

    java week 2 assignment

  6. NPTEL PROGRAMMING IN JAVA WEEK 2 ASSIGNMENT ANSWERS

    java week 2 assignment

VIDEO

  1. NPTEL Programming In Java WEEK 8 Programming Assignment Solutions💡

  2. Programming in Java

  3. iitm English 2 Week 8 Graded Assignment Solutions

  4. Java MOOC Week 2 Exercises 27-31

  5. NPTEL Programming In Java WEEK 1 Programming Assignment Solutions

  6. Assignment operators in java

COMMENTS

  1. Programming in Java

    Programming in Java NPTEL Week 2 Programming Assignment 1 Solutions. Complete the code segment to call the method print() of class Student first and then call print() method of class School. // This is the class named School class School { // This is a method in class School public void print() { System.out.println("Hi!

  2. NPTEL Programming In Java WEEK2 Quiz Assignment Solutions

    🔊 NPTEL Programming In Java WEEK2 Quiz Assignment Solutions | Swayam Jan 2024 | IIT Kharagpur | GATE NPTEL⛳ABOUT THE COURSE :With the growth of Information ...

  3. NPTEL Programming In Java WEEK2 Quiz Assignment Solutions

    🔊 Programming In Java Programming Assignment and Code Link : https://bit.ly/47g6CkMNPTEL Programming In Java WEEK2 Quiz Assignment Solutions | Swayam July 2...

  4. Java NPTEL Solutions Week 2: Mastering Advanced Java Challenges

    Java Week 2: Q1 - Calling 'print()' Using Inner Classes. In this problem, we have an outer class School and an inner class Student. To call the print() method in the Student class, you can create an object of the inner class and use it to invoke the print() method. Here's the solution:

  5. NPTEL Programming In Java WEEK2 Programming Assignment ...

    🔊 Programming In Java NPTEL Elective Course 2023 | GATE NPTEL | https://techiestalk.in/NPTEL Programming In Java WEEK2 Programming Assignment Solutions | Sw...

  6. Programming in Java NPTEL Assignment Answers of Week 2 (2023)

    Week 2 : Programming Assignment 5. Complete the code segment to debug / complete the program which is intended to print 'NPTEL JAVA'. Answer: System.out.print(nptel+space+java+space+nptel); In this article, you will get NPTEL Assignment Answers of Week 2 (2023) of the course Programming in Java.

  7. PDF Java Week 2:Q1

    Java Week 2:Q1 Complete the code segment to call the method print() of class Student. NOTE: Don't provide any INPUT in Sample Test Cases ... I am class STUDENT. Test Case 2 Hi! I am class STUDENT. The due date for submitting this assignment has passed. As per our records you have not submitted this assignment. Sample solutions (Provided by ...

  8. Programming In Java

    "Programming In Java" - Assignment-1 & 2 Solution Released Dear Learners, The Solutions of Assignment- 1 & 2 under Week- 1 & 2 for the course "Programming In Java" has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

  9. PDF Assignment 2

    02/07/2020 Programming in Java - - Unit 4 - Week 2 : https://onlinecourses.nptel.ac.in/noc20_cs08/unit?unit=3&assessment=94 3/6 Live Interactive

  10. NPTEL Programming in Java Week 2 Assignment Solution 2023

    February 8, 2023. Faheem Ahmad. NPTEL Programming in Java Week 2 All Programming Assignment Solutions - July 2022 | Swayam. With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and ...

  11. NPTEL Programming in Java Week 2 Answers

    NPTEL Programming in Java Week 2 Answers nptel java programming week answers manish singh week mcq answers question 10 answers comments reference to the array. Skip to document. University; High School; Books; ... Programming Assignment 2 >> Printer prt = new Printer(); prt(); prt("Hi! I am class STUDENT");

  12. NPTEL Programming In Java Week 2 Assignment 2 Answers

    Question 3. Complete the code segment tocall print () method of class Question by creating a method named 'student ()'. Solution: //Code. These are NPTEL Programming In Java Week 2 Assignment 2 Answers. Question 4. Complete the code segment to call default constructor first and then any other constructor in the class.

  13. cruz-gonzalez/Java-Week-2-Coding-Assignment

    A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior.

  14. NPTEL Programming In Java Assignment 2 Answers July 2023

    NPTEL Programming In Java Week 2 Programming Assignment Answers. 1. Complete the code segment to call the method print () of class Student first and then call print () method of class School. Solution:-. // This is a method in class School. public void print() {.

  15. NPTEL Programming In Java Week 2 Assignment 2 Answers ...

    Programming In Java Week 2 Assignment 2 Answers Solution Quiz | 2023-JanJoin our Telegram Channel : https://telegram.me/SwayamSolverNPTEL - Programming in Ja...

  16. NPTEL Programming in Java Week 2 Assignment Answers 2023

    Programming Answers to Java Assignment. Q1. Complete the code segment to call the method print () of class School first and then call print () method of class Student. School school = new School(); Student student = new Student();

  17. NPTEL Programming In Java Assignment 2 Answers 2022

    NPTEL Programming In Java Assignment 2 Answers:-. Q1. Complete the code segment to call the method print () of class Student first and then call print ()method of class School. Code:-. // Creating object of class Student.

  18. Swayam Solver: NPTEL Programming in Java Jan 2024 Week 9 to 10

    Write a Java program that utilizes multithreading to calculate and print the squares of numbers from a specified begin to a specified end. The main method is already created. ... Week 10 : Programming Assignment 2. Due on 2024-04-04, 23:59 IST. Print a given matrix in spiral form. Follow the naming convention as given in the main method of the ...

  19. Programming In Java || Week 2 || Assignment 2 Solution

    Programming In Java || Week 2 || Assignment 2 Solution || NPTEL Swayam || JAN - 2024 || Due date: 2024-02-07, 23:59

  20. NPTEL Programming In Java Week 8 Assignment Answers 2024

    Programming Assignment Solutions. Question: 1 Write a program which will print a pyramid of "*" 's of height "n" and print the number of "*" 's in the pyramid. These are NPTEL Programming In Java Week 8 Assignment 8 Answers. Question: 2 Write a program which will print a pascal pyramid of "*" 's of height "l".

  21. Swayam Solver: NPTEL Programming in Java Jan 2024 Week 11

    Due on 2024-04-11, 23:59 IST. Due to some mistakes in the below code, the code is not compiled/executable. Modify and debug the JDBC code to make it execute successfully. Your last recorded submission was on 2024-03-30, 17:29 IST. Select the Language for this assignment. File name for this program : import java.sql.*;

  22. Programming In Java WEEK 2 Quiz Assignment Answers

    📌Join this channel to get access to perks:https://www.youtube.com/channel/UCvvEUpqB1AWPB51lW7BhzfQ/join COURSE LAYOUT Week 1 : Overview of Object-Oriented...