Model Viva Questions For "Name of The Lab
Model Viva Questions For "Name of The Lab
Title of the Practical: Program to design comparison two Variable use if statements.
Q1-What is the if statement ?
A1- The if statement is a powerful decision making statement and is used to control the flow of execution of
statements.
Q2- What is the If-else statement ?
A2- The if..else statement is an extension of the simple if statement.
Q3- What is the Switch-case statement ?
A3- The switch statement tests the value of a given variable(or expression) against a list of case values and
when a match is found , a block of statements associated with that case is executed.
Q4- What are the Break ?
A4- The break statement is used to terminate a statement sequence.
Q5-What are Continue ?
A5- The continue statement causes control to be transferred directly to the conditional expression that controls
the loop.
Q6-What is the While loop ?
A6- The while loop is Javas most fundamental looping statement.It repeats a statement or block while its
controlling expression is true.
Q7-What is the Do while loop ?
A7- The do while is an exit controlled loop.Based on a condition, the control is transferred back to a
particular point in the program.
Q8-What is the for loop ?
A8- The for is an entry-controlled loop and is used when an action is to be repeated for a predetermined
number of itmes.
Q9-What is the Operators ?
A9- Operators are used in programs to manipulate data and variables.
Q10-What is the Arithmetic Expressions ?
A10- An arithmetic expression is a combination of variables , constants , and operators arranged as per the
syntax of the language.
Title of the Practical: Program to design toUpperCase() and toLowerCase Type Conversion.
Q1- What is casting?
A1- Casting is used to convert the value of one type to another.
Q2- How many ways can an argument be passed to a subroutine and explain them?
A2- An argument can be passed in two ways. They are passing by value and passing by reference. Passing by
value: This method copies the value of an argument into the formal parameter of the subroutine. Passing by
reference: In this method, a reference to an argument (not the value of the argument) is passed to the
parameter.
Q3- What is the difference between an argument and a parameter?
A3- While defining method, variables passed in the method are called parameters. While using those methods,
values passed to those variables are called arguments.
Q4- What are different types of access modifiers?
A4- public: Any thing declared as public can be accessed from anywhere. private: Any thing declared as
private cant be seen outside of its class. protected: Any thing declared as protected can be accessed by
classes in the same package and subclasses in the other packages. default modifier : Can be accessed only to
classes in the same package.
Q5- What is UNICODE?
A5- Unicode is used for internal representation of characters and strings and it uses 16 bits to represent each
other.
Q6- What is the difference between String and String Buffer?
A6- a) String objects are constants and immutable whereas StringBuffer objects are not. b) String class
supports constant strings whereas StringBuffer class supports growable and modifiable strings.
Q7- What is the difference between Array and vector?
A7- Array is a set of related data type and static whereas vector is a growable array of objects and dynamic.
Q8- What are wrapper classes?
A8- Wrapper classes are classes that allow primitive types to be accessed as objects.
Q9- What are Vector?
A9- Vector : The Vector class provides the capability to implement a growable array of objects.
Q10- What is a stream ?
A10- A Stream is an abstraction that either produces or consumes information.