This document is a question bank for the B.Tech course 'Programming in Java' for the Winter 2024-25 semester. It includes a comprehensive list of questions categorized into three units, covering topics such as Java buzzwords, platform independence, data types, object-oriented programming concepts, inheritance, exception handling, and more. Each question often requires programming examples or explanations to demonstrate understanding of Java concepts.
This document is a question bank for the B.Tech course 'Programming in Java' for the Winter 2024-25 semester. It includes a comprehensive list of questions categorized into three units, covering topics such as Java buzzwords, platform independence, data types, object-oriented programming concepts, inheritance, exception handling, and more. Each question often requires programming examples or explanations to demonstrate understanding of Java concepts.
Course : Programming in Java Course : CSE2006 S. No Questions Unit-1 1. Summarize the Java buzzwords with suitable example. Discuss the four editions of Java with suitable example. 2. Justify – “how the Java language achieves platform independence” with neat sketch. 3. Summarize the Java JVM, JRE and JDK with suitable example. 4. Differentiate C, C++ and Java with example. Classify the Java Data Types with suitable example. 5. Explain the Java Operators with suitable example. 6. Write a java program for area calculation (circle, square, rectangle, cone and triangle) using classes and methods with switch statements. 7. Write a Java program to check whether number is palindrome or not using while, if and else statements. 8. Classify the all types of Java Expressions with suitable examples. 9. Write a program to Find whether number is Prime or Not using for loop. 10. Classify the all types of Flow Control statements with suitable examples. 11. Discuss the java conditional or Selection Statements with examples. 12. Write a following Java program using Flow control statements to get the value at run time. 1. Given year is Leap year or not. 2. Given number is odd or even. 3. Biggest of N numbers and Factorial of a given number. 4. Fibonacci series of a given count. 5. Find the student grade calculation with Grade A, B, C and Fail. 6. Display given multiplication table. 13. Write a java program to find square root of a number without sqrt method. Unit-2 1. Write a java program for bank details using multilevel inheritance for the variables such as to get accno, name, age, gender, acctype, total and display the balance, withdraw, deposit and annual interest. 2. Discuss the three ways to initialize object in Java with suitable example. 3. Identify the need for constructor and its types with suitable example. Differentiate constructors and methods. 4. Write a java program for area calculation (circle, square, rectangle, cone and triangle) using constructor. 5. Write a java program for Library details using Interface for the data members like book_name, book_title, acctype, date and bal. Next to calculate the return date and fine amount if any, finally to display all the details. 6. Implement the Fibonacci Series using recursion with for loop in java.
Programming in Java – Question Bank Page 1 of 3
7. Write a java program to define a class student with data members like name, rollno, age, gender, sub1, and sub2. Defines appropriate methods to initialize and displays the values of data members also calculates total marks, percentage and grade by the ‘n’ number of students. Note: get the values at run time with corresponding objects. Write the sample output with all the operations. 8. Implement the calculator operation using Interface. Create an Interface named arithmetic has declared methods add, sub, mul, div and mod with their method signature as access modifier is public by default, void return type and two int / float arguments as their parameters. A concrete class named as operation has implemented arithmetic interface by providing an implementation of its methods. 9. Write a java program for employee details using class and Encapsulation to get empid, name, salary, PF and HRA. Find total salary for ‘n’ employees. Note: get the values at run time with corresponding objects. Write the sample output with all the operations. 10. Write java program for stack operations that defines an integer stack that can hold 10 values using class and methods. 11. Write a java program for develop the functionality of calculator using classes and methods with switch statements. 12. Identify the need for this keyword in Java. Write a java program for student details using this keyword. 13. Describe the need for final keyword with variable, method and class with suitable example. 14. Classify the types of Inheritance with suitable example for each types. 15. Write a java program for Library management details using Interfaces. Write a java program for simple interest calculation using interface. 16. Write a java program to implement the arithmetic operations using inheritance. 17. Summarize with example for Abstract and Nested Classes. 18. Implement Arithmetic operations (Add, Sub, Mul, Div and mod) using Muti-level inheritance. 19. Implement the stack operations using Interfaces with 10 different values to get in run time. 20. Explain with example for three usage of Java super keyword in details. 21. Find the area calculation like square, rectangle, triangle and circle using Method Overriding. 22. Discuss the concept of run-time polymorphism. Write a java program for area calculation of Rectangle and Triangle using run-time polymorphism. 23. Implement the bank interest calculation using Method Overriding. 24. Differentiate abstract class and interface. Implement the stack operations using Interface. 25. Implement Employee details (Emp_ID, Name, Age, Salary and dept) using Encapsulation. 26. Discuss the concept of Java Reflection with neat diagram and example. 27. Describe the need for Java Singleton class with example.
Programming in Java – Question Bank Page 2 of 3
Unit-3 1. Identify the need for Exception handling with suitable example. 2. Summarize the hierarchy of Java Exception classes with neat sketch. 3. Classify the types of exceptions and its java exception keywords with suitable example. 4. Discuss the common scenarios of java exceptions with suitable example. 5. Summarize the Java Built-in Exceptions with suitable example. Wish you all the best.