Java Programming 2018 Question Paper — Government College of Engineer…
The 2018 Java Programming previous year question paper (Government College of Engineering and Technology, Jammu), with every question and its marks.
- University: Government College of Engineering and Technology, Jammu
- Subject: Java Programming
- Course: JAVA PROGRAMMING
- Branch: Information Technology Engg.
- Year: 2018
- Paper: end-term
- Duration: 180 minutes
- Total marks: 100
Instructions
- Attempt five questions in all, selecting at least two questions from each section.
Questions
SECTION-A
- QQ1. (a). Explain different data types in Java. Give example. [10 marks]
- Q(b). What is class? How does it accomplish data hiding? How do classes help us to organize our programs? [10 marks]
- QQ2. (a). What is a constructor? What are its special properties? How do we invoke a constructor? [10 marks]
- Q(b). Demonstrate how objects are passed as function parameters with a suitable example. [10 marks]
- QQ3. (a). Define inheritance. What are the benefits of inheritance? What costs are associated with inheritance? How to prevent a class from inheritance? [10 marks]
- Q(b). Write a java program that illustrates how 'this' keyword can be used to resolve the ambiguity between formal parameters and instance variables. [10 marks]
- QQ4. (a). Create an inheritance hierarchy of Rodent: Mouse, Gerbil, Hamster, etc. In the base class, provide methods that are common to all Rodents, and override these in the derived classes to perform different behaviors depending on the specific type of Rodent. Create an array of Rodent, fill it with different specific types of Rodents, and call your base-class methods. [10 marks]
- Q(b). Develop a Java package named 'even package', with a class Even containing a static method that check whether a number is even or not and returns that information. Import this package in another class and use to check a number is even or not. [10 marks]
SECTION-B
- QQ5. (a). What does a dynamic Billboard Applet do? What are the three main classes that the applet contain? [10 marks]
- Q(b). Explain the following layout managers. (a) Borderlayout (b) Gridlayout (c) Flowlayout [10 marks]
- QQ6.. List Java's Built-in Exception? Write the importance of finally block. Write a java program to create own exception for Negative Value Exception if the user enter negative value. [20 marks]
- QQ7. (a). What is the difference between process based and thread based multi-tasking? Give the two ways by which a thread can be created using Java. [10 marks]
- Q(b). Write 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. [10 marks]
- QQ8. (a). Write a java program to implement join() method in multithreading. [10 marks]
- Q(b). Write a program to read a file content and extract words using String Tokenizer class. Display the file if it contains the user query term/search key. [10 marks]
Related pages
Other years
- Java Programming 2018 question paper — end-term