Lab (HTML) REPORT
Lab (HTML) REPORT
LAB REPORT
MCQ
SWET SHEERSH
7/22/2023
L3
1 How many Data types in java? 2 (primitive & Non-primitive)
3(instance var.,local var.,static
2 how many types of variable?? var)
3 "native" is keywowd, is it true?? Yes True
4 keywords are?? Reserved identifiers
5 what is the size of float?? 32 bit
6 which data type having size 1 bit?? boolean
7 Logical NOT (!) is a type of ?? unary operator
8 "++" operator is used for?? Increment
9 " !=" is which type of operator? Relational Operator
10 In Java, string is an object that represents ?? sequence of char values
L4
1 object is an?? Instance of class
2 class is blue print of?? object
3 packages are used to reduce?? Naming conflict
4 private keyword is?? Access Modifiers
5 static import is used for importing static members
6 which pakage contains sqrt method?? java.lang.Math
7 static methods of class can be called without creating instance
8 private variable cannot be accessed outside the class
9 private variable with getter and setter is used for Encapsulation
L5
1 which keyword is used for creating an object? New
2 object is parent class for every java class implicitily TRUE
L6
characteristics and property from
1 inheritance is the mechanism of inheratating parent class
2 inheritance is used for enhancement and alteration
2|Page
3 Java supports only which types of inheritance Single, Multilevel, and Hierarchical
4 which keyword is used for inheritance? extend
5 Any class preceding a specific class in the hierarchy is said to be super class
6 super keyword is used to refer?? instance of parent class
7 instanceof keyword is ued for check whether object is instance of class
8 ways in which polymorphism is implemented 2
9 Method Overloading is compile time polymorphism TRUE
10 Method overriding is run time polymorphism TRUE
L7
1 Abstruct class can only have abstruct methods FALSE
2 we can't create an instance of abstruct and interface
3 Abstruct class can only be implemented by using extends keyword
4 Interface can be implemented by using implements keyword
5 Abstruct method can have implemented method Yes
6 Interface methods can only be implemented if it is static or default
7 default method is used in interface (after java 8)
8 can default method be overriden?? yes
9 static method is accessed without creating an object
10 static method can be overriden FALSE
L8
1 What does the "^" represent in a regex? start
2 method in Java is used to find the first occurrence find
3 "\d" is used to match what type of character? digit
4 "[A-Za-z]" is used to match ? Letters
5 what does the metacharacter "." represent? Any Character
6 "\b" is used to match word boundary
L9
1 What is an exception in Java? Error
2 keyword is used to handle exceptions in Java? try
3 Which block is used to handle the exception? catch
4 which block executes regardless of any exception? finally
What is the process of creating your own exception class in
5 Java? Customization
6 What is the root class of all Java exceptions? Throwable
3|Page
L1
0
1. What is a fixed-size data structure that stores elements of
the same type in contiguous memory locations in Java?
Answer: Array
L1
1
1. What is a "Collection" in Java?
Answer: Group