Programming in Java - - Unit 4 - Week 1 _
Programming in Java - - Unit 4 - Week 1 _
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
Week 0 : () d. // comment
Yes, the answer is correct.
Week 1 : () Score: 1
Accepted Answers:
Lecture 01 : c. /* comment /
Introduction
(unit? 2) What is the output of the following code? 1 point
unit=18&lesso
n=19)
public class Main {
Lecture 02 :
public static void main(String[] args) {
Java
Programming String str1 = "NPTEL";
Steps (unit?
String str2 = "java";
unit=18&lesso
n=20) int a = 20;
Lecture 03 :
int b = 24;
Java Tools and System.out.println(str1 + a + b); // Statement 1
Resources
(unit?
unit=18&lesso System.out.println(a + b + str2); // Statement 2
n=21)
}
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=18&assessment=388 1/4
13/11/2024, 15:25 Programming in Java - - Unit 4 - Week 1 :
Lecture 04 : }
Demonstration
-I (unit?
unit=18&lesso a. NPTEL2024
n=22)
44java
Lecture 05 : b. NPTEL44
Java Applet 44java
Programming
c. NPTEL2024
(unit?
unit=18&lesso 2024java
n=23) d. NPTEL44
2024java
Feedback
Form (unit? Yes, the answer is correct.
unit=18&lesso Score: 1
n=24) Accepted Answers:
a. NPTEL2024
Week 01 :
44java
Programming
Assignment 1 3) Which of the following is used to find and fix bugs in the Java programs? 1 point
(/noc24_cs105
/progassignme a. JVM
nt?name=361)
b. JRE
Week 01 : c. JDK
Programming
d. JDB
Assignment 2
(/noc24_cs105 Yes, the answer is correct.
/progassignme Score: 1
nt?name=362) Accepted Answers:
d. JDB
Week 01 :
Programming
4) What is the value returned by the method f() defined below ? 1 point
Assignment 3
(/noc24_cs105
/progassignme public static int f(int x, int y){return (x>y) ? y : x;}
nt?name=363)
Week 01 :
Programming a. The sum of x and y, that is, x + y.
Assignment 4 b. The difference of x and y, that is, x - y.
(/noc24_cs105
c. The maximum of x and y, that is, the larger value of x and y.
/progassignme
nt?name=364) d. The minimum of x and y, that is, the smaller value of x and y.
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=18&assessment=388 2/4
13/11/2024, 15:25 Programming in Java - - Unit 4 - Week 1 :
Week 2 : () }
}
Week 3 : ()
}
Week 4 : ()
Week 11 : () b. javac
c. java
Week 12 : () d. javad
System.out.println(x);
}
}
a. 50
b. 10
c. Compiler error
d. 5
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=18&assessment=388 3/4
13/11/2024, 15:25 Programming in Java - - Unit 4 - Week 1 :
9) In Java, what is the role of the public static void main(String[] args) method? 1 point
a. Initialization method
b. Execution entry point
c. Constructor
d. Destructor
https://onlinecourses.nptel.ac.in/noc24_cs105/unit?unit=18&assessment=388 4/4