Skip to content
IT-504 (C) · Java Programming/Unsolved PYQ Paper

IT-504-C Java Programming - Dec 2024 Question Paper

Under each question, How to answer lists the points an answer should cover, outlined by CampusPrep from the syllabus. Check the details against your textbook.

  1. 7 Marks
    aIllustrate the Iteration Statements with example.
    How to answer
    • Define iteration statements in Java
    • Explain while, do-while and for with syntax
    • Give example program for each
    • Mention enhanced for loop
  2. 7 Marks
    bDemonstrate what are Jump statements? Give an example for each of them.
    How to answer
    • Define jump statements
    • Explain break with example
    • Explain continue with example
    • Explain return with example
  3. 7 Marks
    aWhat is a Constructor? Explain types of Constructors in Java? Write a java program to find the Area of Circle using Constructor.
    How to answer
    • Define constructor and its properties
    • Explain default, parameterized and copy constructors
    • Write Java program using constructor to calculate area of circle
    • Show output with formula Area = pi*r*r
  4. 7 Marks
    bDiscuss about the static, final keywords with an example.
    How to answer
    • Define static keyword: variable, method, block, class
    • Define final keyword: variable, method, class
    • Give example program using static and final
    • Mention key differences and use cases
  5. 7 Marks
    aExplain about the Dynamic Method Dispatch in Java with example program.
    How to answer
    • Define dynamic method dispatch and runtime polymorphism
    • Explain superclass reference to subclass object
    • Give example program with overridden method
    • Explain how method resolution occurs at runtime
  6. 7 Marks
    bWhat is an Abstract class? Explain all the cases to implement abstract class.
    How to answer
    • Define abstract class and abstract method
    • Explain rules for declaring and extending abstract class
    • Explain cases: with abstract methods, without, constructor
    • Give example program
  7. 7 Marks
    aWrite a java swing program to find the sum of two numbers.
    How to answer
    • Design JFrame with JTextFields and JButton
    • Add ActionListener to read inputs and compute sum
    • Display result in label/textfield
    • Provide complete Swing code
  8. 7 Marks
    bExplain the life cycle of applet.
    How to answer
    • Define applet
    • Explain init(), start(), stop(), destroy(), paint() stages
    • Describe sequence with diagram
    • Mention methods called by browser
  9. 7 Marks
    aExplain Java garbage collection mechanism.
    How to answer
    • Define garbage collection and automatic memory management
    • Explain how objects become eligible and finalize()
    • Explain gc() and JVM garbage collector working
    • Mention advantages
  10. 7 Marks
    bWrite a program in Java to find $n^{th}$ prime number where $n$ is any integer and should be taken as input from the user.
    How to answer
    • Read n as input using Scanner
    • Implement isPrime check loop
    • Count primes until nth prime found
    • Print nth prime with sample output
  11. 7 Marks
    aExplain the difference between method overriding and method overloading with the help of suitable example.
    How to answer
    • Define method overloading: same name, different signature, compile-time
    • Define method overriding: same signature, inheritance, runtime
    • Compare on binding, inheritance, return type rules
    • Give example program for both
  12. 7 Marks
    bWhat is multithreading in Java? Explain the inter thread communication with the help of suitable example.
    How to answer
    • Define multithreading and Thread lifecycle
    • Explain wait(), notify(), notifyAll() for inter-thread communication
    • Explain synchronized and producer-consumer concept
    • Give example program
  13. 7 Marks
    aWrite a Java program that creates three threads. First thread displays "Hello!" every one second, the second thread displays "Wear Mask!" every two seconds and "Use Sanitizer!" every 5 seconds.
    How to answer
    • Create three Thread/Runnable classes
    • Use sleep(1000), sleep(2000), sleep(5000) in loops
    • Print Hello!, Wear Mask!, Use Sanitizer! respectively
    • Start threads in main method
  14. 7 Marks
    bWhat is introspection in java beans? Explain how BeanInfo interface helps in introspection of beans?
    How to answer
    • Define introspection in JavaBeans
    • Explain Introspector and BeanInfo interface
    • Explain how explicit BeanInfo customizes properties/events
    • Mention design patterns and descriptors
  15. 7 Marks
    aExplain the following methods bind(), rebind(), createSubcontext(), getAttributes(), modifyAttributes() method with syntax.
    How to answer
    • Explain JNDI/ directory context methods
    • Give syntax of bind(), rebind(), createSubcontext()
    • Give syntax of getAttributes(), modifyAttributes()
    • Mention NamingException and example usage
  16. 7 Marks
    bExplain in detail about throw and throws statements with examples.
    How to answer
    • Define throw for explicitly throwing exception
    • Define throws for declaring exceptions in method signature
    • Compare throw vs throws with syntax
    • Give example programs for both
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in