Content text 2.object oriented concept using java-2022.pdf
ii. Time:2 Hours ii. iv. V. Second Semester B.C.A. Degree Examination October / November - 2022 (NBB 0220) : OBJECT ORIENTED CONCEPTS USING JAVA (a) Method (c) Instance variable (CBCS NEP Scheme) Select the most appropriate answer from the options provided. statement. The entity which binds together the properties and behaviour related to an object is Java provides both signed and unsigned version of data types SECTION - A In a class, constructor is (a) Provides signed and unsigned versions for only integer types. (d) Java does not support datatypes. (c) Provides only signed versions of datatypes. (a) An instance variable (b) An object of the class (b) Class (d) All the above (b) Provides signed and unsigned versions for only floating - point types. (c) A special private method of the class Q.P. CODE 34222 (d) A special public method of the class (a) Only the subclasses (c) Nowhere Protected members of a class are accessible by Max. Marks :60 (b) All the classes inside and outside the current package Which among the following is not the correct way of instantiating String class. (a) String obj = new String ( ): (b) String obj = new String ("$himoga"); 1 (10x1=10) correct the (d) All the classes in the current package and the subclasses in other packages. (c) String obj = new String (577 401); (d) String obj = "Karntaka":
vi. vii vii ix. X. II. 2. 3 4. 5. 6. 7 8 9 The default package referenced by Java environment is (a) java. Util (b) java.io The default priority levels of all the threads in Java is. (a) NORM_PRIORITY (c) MAX_PRIORITY In method overriding, (c) (d) (a) A class will contain multiple methods with same name and same signature. (b) A class will contain multiple methods with same name but different signature. Default layout in Java awt is (a) FlowLayout (b) CardLayout In Java, event handlers are, A class will contain multiple methods with different name but same signature A subclass will contain the version of a super class method with same name and same signature. (a) Event classes (c) Class variable (b) MIN_PRIORITY (d) ZERO _PRIORITY Briefly describe the following concepts. (a) Encapsulation SECTION -B Write a short notes on any FIVE of the following. (c) DefaultLayout (d) AbsoluteLayout (b) Event Listener Interfaces (d) Methods (b) Dynamic Binding (d) java.lang Q.P. CODE 34222 Write a note on any two visibility modifiers available in Java. 2 With syntax and example, explain how to declare and initialize a two dimension array in Java. (c) Polymorphism Write a note on finally keyword in exception handling. How StringBuffer is different from String class? With syntax and example , explain the capacity( ) method of StringBuffer Class. What is a Generic Class? Explain the advantage of using Generic Class. With an example, explain how an interface is declared in Java. "Swing is more efficient than awt'". DiscusS. (5x3=15) (c) java.awt ,
lI. 11. Through a Java program, explain the use of this' keyword. 12. Answer any THREE question from the folowing. 10. Describe the numeric datatypes available in Java. Also tabulate these types with the size and range. 13. IV. With inheritance diagram for each, explain multilevel and hierarchical inheritance. Demonstrate the creation of threads by using 'Runnable' interface. Write a simple Java program as an illustration. 14. What is a Layout Manager? Write brief note on BorderLayout and GridLayout. Answer the following. 15. a) b) 16. a) b) Q.P. CODE 34222 (3x5=15) OR Write a Java program to find the biggest among 2, 3 and 4 numbers by overloading the method to find the biggest. OR (2x10=20) Write a Java program to find the sum and average of the elements of a two dimension array. Read the elements of the array using readLine () method. With syntax and example for each, explain the looping statements of Java. *** Explain the exception handling mechanism of Java with a note on try, catch, throw & throws.