Sunday , 23 July 2017
Home » Class 12 » ISC Computer Science Practical Viva Questions

ISC Computer Science Practical Viva Questions

I have tried to list down some of the commonly asked viva questions. Very rarely, but questions can be asked outside of this list.

Please note that questions will be based on your program. When you are asked about anything. Answer it to the point. Don’t try and go overboard to show your knowledge and connect it to some other concepts. It won’t fetch you marks but on the contrary, the teacher may question you from that concept as well.

For example, if you are asked about the difference between print() and println() function and you reply, “These functions are present in the System class of the java.lang package. The print() functions prints a line and the control remains on the same line, whereas, the println() function prints a line and the control moves on to the next line.

If you see this answer, then it looks perfect and shows the knowledge of the student. But it can attract more questions like:

Name some other classes of java.lang package. What is ‘out’ in the line System.out.println() and so on.

Stick to the point and answer like: “The print() functions prints a line and the control remains on the same line, whereas, the println() function prints a line and the control moves on to the next line.”

Note: This article may be updated with some more viva questions. I would request the students to send me the viva questions which they face in their examination so that this list could be further improved.

Some Viva Questions and Answers:

What is OOP?

A: Object-oriented programming (OOP) is a programming paradigm that represents concepts as “objects” that have data fields (attributes that describe the object) and associated procedures known as methods.

Is Java an Object Oriented language?

A: Yes.

What is Encapsulation? How is it implemented in Java?

A: Binding up of data and associated functions together into a single unit called (class) is called Encapsulation. In Java, it is implemented by the use of a class.

What is Data Abstraction? How is it implemented in Java?

A: Act of representing only essential features without including its background details is called Abstraction. Data Abstraction can also be defined as the process of hiding the implementation details and showing only the functionality. In Java, it is implemented by the use of interfaces or by making the class abstract.

What is Polymorphism? How is it implemented in Java?

A: It literally means the ability to take ‘more than one forms’. The ability of a method to behave in more than one form is called polymorphism. In Java, it is implemented by method (function) overloading (compile time polymorphism) and method overriding (runtime polymorphism).

What is Inheritance? How is it implemented in Java?

A: The ability of a class to adopt/share the properties (data and functions) completely or partially from another class is called Inheritance. In Java, it is implemented by the use of the keyword, extends.

What is the benefit of Inheritance?

A: It is a very useful feature as it provides the concept of reusability. Also, it allows us to include or remove any features to an existing class without modifying it.

What is significance of import java.io.* in your program?

A: The line imports all the classes of the java.io package into the current program.

Give some examples of packages.

A: java.util, java.lang etc.

Why did you write java.util package? (only if you use classes like Scanner or StringTokenizer)

A: To include the functions of the Scanner or StringTokenizer class from the java.util package.

What is a class?

A: A class is a blueprint or prototype from which objects are created.

What is an object?

A: An object is an instance of a class.

How to create an object?

A: Objects of a class can be created as by declaring it and then instantiating it using the ‘new’ operator as follows:
class-name object-name = new class-name();
Example: Point ob = new Point();
The above line creates an object of the Point class.

Why do you write BufferedReader br = new ……. ?

A: To activate the Buffer memory for efficient input and output operations. ‘br’ is an object of the BufferedReader class.

What is a Buffer and what is its use?

A: Buffer is a temporary memory used for efficient input and output operations.

What is the function of readLine() method?

A: readLine() method reads a line of text (which you input) and returns the result in the form of a String.

Why do we have main() function?

A: The execution of the program begins from the main() method.

Why is the main method public?

A: So that it be accessible to the JVM which begins to execute the program from outside of the class.

Why is the main method static?

A: So that it be available for execution without the need of any object.

Is it compulsory to write String args[] when running a program in BlueJ?

A: No it is not compulsory when we are running it in BlueJ. But normally (in all other cases) it is always better to have it, as the JVM looks for the main method with a String array as a parameter.

What is the use of out in System.out.println()?

A: ‘out’ is an object of the ‘PrintStream class and a static data member of the’System’ class which is calling the println() function.

What is the difference between print() and println() methods?

A: The print() functions prints a line and the control remains on the same line, whereas, the println() function prints a line and the control moves on to the next line.

Can a package be called as a class?

A: Yes, Package is actually a class present in java.lang package.

Why do you write ‘throws IOEXception’?

A: For handling any input/output exceptions.

What are exceptions?

A: Exceptions are runtime errors which prevent the program from working normally.

Mention the two types of exceptions?

A: Checked Exceptions – Exceptions which are checked (handled) during compile time by the compiler.
Example: IOException.

Unchecked Exceptions – Exceptions which are not checked during compile time.
Example: ArrayIndexOutOfBound.

Mention other ways in which java handles exceptions.

A: Java can handle exception using the try-catch block, throws keyword and throw keyword.

What is the difference between throws and throw?

A: Using throws keyword, we can give system defined error message if any error occurs, while using throw keyword, we can force an exception and give user-defined error messages.

What is try-catch block?

A: try-catch block is a way to handle exceptions in Java. try contains a block of statements to check for any error. If any error occurs within the try block, it is trapped. Further a report is passed to the exception handler about the error, which is done by the catch block.

What is finally block?

A: finally block contains statements which are to be executed irrespective of any errors. It is used along with the try-catch block.

Which keyword is used to raise an exception?

A: throw keyword.

State any two IOException classes.

A: EOFException and FileNotFoundException.

Name the primitive data-types in java.

A: byte, short, int, long, float, double, char and boolean

What are comments? Name the different types.

A: Comments are statements which enhances the readability and understanding of the program. They are not part of the program.

The different types are: single line (//….), multiple line (/* … */) and documenting comment (/**….*/).

Why is the ‘S’ of System.out.println() function capital?

A: System is the name of a class present in java,lang package and hence it begins with a capital letter as is the convention for class names.

Why is the ‘S’ of String capital?

A: Since String is a class.

What is a variable?

A: A variable is a named memory location whose value can change.

What is a constant?

A: A constant is a literal which cannot be changed.

How do you make a variable into a constant?

A: By adding the keyword ‘final’ before a variable declarations. Example: final int a  = 5;

What are postfix and prefix operators?

A: Both postfix and prefix operators change (increase or decrease) the value of a variable by 1. In postfix, the old value of the variable is first used and then the variable is updated to the new value, whereas in prefix, the value of the variable is first updated to the new value and then this new value is used.

What is the use of final keyword?

A: Final can be used in three scenarios:
a) final before a variable makes it a constant.
b) final before a function declaration prevents it from being overridden.
c) final before a class declaration prevents it from being inherited.

What is a class variable?

A: Instance variables having the keyword ‘static’ before it is a class variable. For every object there is just one copy of the variable made.

What does System.in.read() return?

A: It returns the number of bytes read from the Input Stream as an integer.

Why do you write ‘Integer.parseInt(br.readLine())’?

A: The inputs in a java program comes in the form of String objects which are read using the br.readLine() function. Now if we want the input in integer form, we have to convert it into integer using the parseInt() function of the Integer wrapper class.

What are wrapper class?

A wrapper class is a class which wraps (encloses) around a data type and gives it an object appearance. Wherever, the data type is required as an object, this object can be used.

What is type conversion? Name its types.

A: Converting a value of a particular data type into another data-type is called type conversion. It is of two types:

(a) Implicit Type Conversion: When the conversion takes place on its own without the programmer’s intervention.
(b) Explicit Type Conversion: When the conversion takes place with the programmer’s intervention.

What is the difference between casting and coercion?

A: Type Casting refers to Explicit type conversion i.e. When the conversion takes place with the programmer’s intervention, whereas, Coercion refers to Implicit type conversion i.e. When the conversion takes place on its own without the programmer’s intervention.

What is the difference between if and switch?

A:
(a) if can compare conditions for all data types whereas, switch can only check integers and characters.
(b) all kinds of relations can be checked using if whereas only equality relation can be checked using switch.

What is fall-through?

A: In the absence of ‘break’ keyword after a case in a switch-case construct, the control falls to the next case. This is known as fall-through.

What is the difference between for and while?

A: The difference lies in the way they are commonly used. for loop is commonly used when the number of iterations are known whereas, while loop is commonly used when the number of iterations are not known.

What is the difference between do-while and while?

A: do-while lop is exit controlled (i.e. condition is checked at the exit) and runs at least once even if the condition is false whereas, while loop is entry controlled (i.e. condition is checked at the entry) and does not run even once if the condition is false.

What is recursion?

A: It is a process in which a function calls itself repeatedly until some base condition is satisfied.

What is the difference between recursion and iteration?

A: Recursion is usually slower than iteration due to overhead of maintaining stack, whereas, Iteration does not use stack so it’s faster than recursion.

Recursion uses more memory than iteration, whereas, Iteration consume less memory.

Recursion makes code smaller, whereas, Iteration makes code longer.

What is the use of return keyword?

A: return keyword is used to return any value from a function. It denotes the end of a function.

Can there be multiple return statements in a function?

A: Yes, but only one of them is executed.

Can two functions have the same name? Give examples.

A: Yes. In function overloading and function overriding.

What is the difference between function overloading and function overriding?

A: In function overloading only the function name is same but function signature (list of parameters) is different, whereas, in function overriding both the function name as well as function signature are same

Function overloading takes place within the same class, whereas, function overriding takes place in a child and a parent class.

Function overloading is an example of static polymorphism, whereas, function overriding is an example of dynamic polymorphism.

What is a constructor?

A: It is a member function with the same name as that of a class and is automatically called for initializing the variables of an object.

What is a copy constructor?

A: It is a constructor which takes object as parameter and copies the value of the instance variable of that object to another object (creates a copy of an object).

What is the default access specifier?

A: friendly

What is a modifier?

A: A modifier is a keyword placed in a class, method or variable declaration that changes how it operates. Examples of modifiers are: abstract, final, static etc.

What is the default java package?

A: java.lang

What is the use of ‘new’ keyword?

A: It is used for dynamic memory allocation to reference data types.

What is the use of ‘this’ keyword?

A: It is used to refer to the current object (the object which calls the function).

What are arrays?

A: Arrays are a collection of variables of the same data-type referenced by a common name.

What is the significance of arrays?

A: It helps to group similar variables under a common name, hence reducing the number of names of variables we have to remember.

What is StringTokenizer or Scanner and examples of similar classes (if you used it)

A: StringTokenizer or Scanner is a class which splits up any given string into tokens separated by delimiters.

Name some function of StringTokenizer class.

A: nextToken(), countToken(), hasMoreTokens() etc.

Name some function of Scanner class.

A: next(), nextInt(), hasNextInt() etc.

Name some other concepts related to Scanner/StringTokenizer

A: Scanner class, StringTokenizer class, split() function.

What is split() function?

A: split() function is a function of the String class and it breaks up any String into tokens and outputs the result in the form of an array.

What is the use of charAt() function?

A: This function is used to extract characters at any given index from a String.

What is the difference between length() and length?

A: length() function is used to find the number of characters present in a String, whereas, length keyword is used to find the number if cells in an array.

What is the difference between break and continue?

A: break keyword stops the complete loop and takes the control out of the loop, whereas, the continue keyword just stops the current iteration and takes the control to the next iteration.

What is the difference between selection sort and bubble sort?

A: In selection sort, successive rounds are executed to select the element which is required to be placed in their sorted position, whereas, in bubble sort, every consecutive pairs of elements are compared and interchanged as required to place them in their sorted position.

If we are arranging an array is ascending order, then in selection sort, we get the smallest element at every pass, whereas, in bubble sort we get the largest element in every pass.

What is the drawback of an array?

A: Its size cannot be changed.

When does Binary search fail?

A: When the array is not sorted.

What is the difference between linear and binary search?

A: Linear search does not require the array to be sorted, whereas, binary search requires that the array be sorted.

Linear search checks for the search item in a linear fashion from the beginning cell till the end, whereas, Binary search repeatedly dividing the array into halves and the search takes place in one of the halves. The element is searched in the middle cell of every half.

The Examiner may ask you to explain in brief the logic used you to solve the program.

You know what you have written so just give a brief summary of the logic used by you.

The Examiner may ask you to tell what is control variable in your loop.

So if your loop is for(int i = 1; i <= 5; i++) then the control variable is ‘i’.

The Examiner may ask you to tell what is the return type of a function you used.

So if your function is boolean isPrime(int n) then the return type is ‘boolean’.

What is a queue? Give a real life example.

A: It is a linear data structure which follows the FIFO (First In First out) pattern.

Real life example: Queue at the ticket counter

What is a stack? State it’s application.

A: It is a linear data structure which follows the LIFO (Last In First out) pattern. Stack memory is used in recursion.

Application: It can be used for reversing strings, for evaluating postfix expressions.

What is an abstract class?

A: An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.

What is an abstract method?

A: An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon), like this:
abstract void point(double x, double y);

What is the difference between keywords and reserved words?

A: Keywords have a special meaning in a language, and are part of the syntax.
Reserved words are words that cannot be used as identifiers (variables, functions, etc.), because they are reserved by the language.
Example: In Java, goto is a reserved word but not a keyword (as a consequence, you cannot use it at all)

What is the similarity between a method and a constructor?

A: Below are some of the similarities:
1) Both of them are member methods of any class.
2) Both can be parameterised or non-parameterised.
3) Both can be overloaded.

What is the difference between naming conventions and naming rules?

A: Violating naming rules will result in a syntax error, whereas, violating naming conventions will not result in any error.

What error will be generated if a space is given between the logical AND operator (&&)? Will it be a compile-time or a run-time error?
Example: if(5>2 & & 6<9)

A: It will give an “Illegal start of expression” error. It will be a compile time error.

What is an interface? How is it useful?

A: Interface is like a class that contains declaration of methods and variables without the function definition. It helps in implementing multiple inheritance.

What is super keyword?

A: It is a keyword which is used to access the data members and methods of the super class from within the sub class.

What is super constructor?

A: It is a constructor which is used to call the constructor of the super class and hence initialize the data members of the super class from within the sub class.

What is complexity?

A: Complexity refers to the measure of the performance of an algorithm.

What are the different types of complexities?

A: Time Complexity (Temporal COmplexity) : The measure of the total amount of computer time taken to run for completion of an algorithm is known as time complexity.
Space Complexity:
The measure of the total amount of memory space needed to run for completion of an algorithm is known as space complexity.

What is the difference between Call by value and Call by reference?

A: Call By Value : When a function is called by value, then the value of the actual parameter is copied to the formal parameter (i.e. a separate copy is made). Any changes made with the values of the formal parameter does not affect (change) the actual parameter.
Call By Reference : When a function is called by reference, then the reference(address) of the actual parameter is sent to the formal parameter. Any changes made with the values at that address of the formal parameter affects (changes) the value of the actual parameter.

Note: I know that I have not been able to reply to most of the student’s query which they have been sending me through e-mails and as comments. I apologize for that. The tight schedule has kept me from replying to the wonderful queries from my wonderful students. But whatever little, I hope I was able to help you all out.

All the best for your ISC Computer Science Practical and Theory Examinations.

Check Also

[Question 2] ISC 2017 Computer Practical Paper Solved – Quiz Result

Solution of Program 2 of ISC 2017 Computer Science Paper 2 (Practical) Exam. Java program to input the answers of each participant row-wise and calculate their marks

72 comments

  1. Nice qns. hoping to score well!!!

  2. All the best y’all for the exams! Great help from this site

  3. Thank you for the help. This site is extremely good. I have even recommended it to my friends.

  4. Is this questions enough for viva sir

  5. Sir for isc viva questions also is it usefull ?

  6. tnkuuu….
    its being a grt help fr me….
    in cs … 🙂

  7. wish i had known about this site earlier …. its of great help ..thank you so much 🙂

  8. This is very helpful I just hope that my practical exams go well tomorrow

  9. Sir, what is the difference between subscripted and subscript?

  10. Plz tell the use of the dot operator in the function calling statement

    • dot operator is used to access the data members of a class. So, dot operator in a function calling statement is used to access (invoke) the function of that class.

  11. Sir is it enough if we just learn all these definitions ??

  12. Thank you sir,this is helpful for the students.

  13. very helpful….

  14. can we use string tokenizer in isc theory and practical programs? or will marks be deducted for that?

  15. Sir will it help me in my 10 class board viva

  16. sir… i want to ask whether the two exceptions are 1.runtime exception 2.comple time exception but rather wat u hav given 1.checked exception 2. unchecked exception??

    • The proper terminology to use with regards to categories of Exceptions are Checked or Unchecked.

      Checked Exceptions – Exceptions which are checked (handled) during compile time.
      Example: IOException.

      Unchecked Exceptions – Exceptions which are not checked during compile time.
      Example: ArrayIndexOutOfBound.

      Few refer to Checked Exception as Compile Time Exception and Unchecked Exception as Run Time Exception.

  17. it is very useful thank you

  18. Thanx a lot…it is helping me alot

  19. Sir, could you please explain the difference between dynamic and static binding?

    • Binding refers to resolving which methods or variables are to be called when there are more than one methods or variables with the same name in the class (or subclass).
      If this resolving is done during compile time, then it is known as Static Binding.
      If this resolving is done during run time, then it is known as Dynamic Binding.

      Function Overriding (a concept implemented in inheritance) is an implementation of Dynamic Binding, while Function Overloading is an implementation of Static Binding.

  20. Saptarshi chakraborty

    AWESOME !!!! reduced my work load THANKS

  21. ‘out’ is not an object of System class. It is an object of PrintWriter class and it is a static data member of System class.

  22. Thanks a lot sir! Because of your tips to write algorithm  and viva questions, I think I can expect 99 .

  23. Thanks for the developer of this site..amazing..

  24. Sir…difference between public private and protected access specifier..???

    • Remember this short table:

      Access Levels
      Modifier Within Same Class Within Same Package By Subclass World (Anywhere)
      public Y Y Y Y
      protected Y Y Y N
      no modifier (friendly) Y Y N N
      private Y N N N

      A class may be declared with the modifier public or no modifier. Other members of the class have two additional access modifiers: private and protected.

      1. The public modifier specifies that the class is visible to all classes everywhere.
      2. If a class has no modifier (the default, also known as package-private or friendly), it is visible only to the classes within its own package.
      3. The private modifier specifies that the member can only be accessed in its own class.
      4. The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package.
  25. Seriously Sir….tomorrow is my ISC Computr Prac Exam..nd i didnt knew wat to study 4 dis viva…it has been wonderful reading ur questions and answers…u have covered d major part of the syllabus…Thanxxx a lot Sir.. 🙂 Nd plzzz carry on with ur site because computr students are soo underrated dat dey dnt even publish a test paper 2 practise 4 xams… Thankuu Sirr… it has been wonderful.. 🙂

  26. is this much questions enough for viva?

  27. sir defination of try and catch

    • try-catch block is a way to handle exceptions in Java. try contains a block of statements to check for any error. If any error occurs within the try block, it is trapped. Further a report is passed to the exception handler about the error, which is done by the catch block.

  28. i hope kal viva me ye kaam aa jaaye
    btw thanx a lot

  29. sir can u tell me two diffferences between equals() and compareTo()…..plz

    • Here are the differences:
      1) equals() function checks whether two strings are equal or not in all respect, whereas, compareTo() function checks 2 strings alphabetically
      2) equals() function returns either a true or a false, whereas, compareTo() functions returns an integer number which is either equal to zero, or greater than zero or less than zero.

  30. what are difference between

    sub class,super class,main class,base class

     

    example of instance class

    sir you told -“function overriding takes place in a child and a parent class.” Does it mean function overriding is used in concept of inheritance?

    sir will program from string tokenizer?

    • Super class and Base class are one and the same thing. It is a class whose data members and functions are inherited.
      Sub class is a class which inherits the data members and functions of its base class.
      Main class refers to the class which executes both the base and the sub class in required order by creating necessary objects of both the classes.

      Yes the concept of Function Overloading takes place in Inheritance relation only.
      It won’t be specifically mentioned that you use StringTokenizer. But using StringTokenizer or split() function makes a String program simpler.

  31. thank you sir

    this site rocks

  32. Thanks a lot. This is really helpful.

  33. sir what is diiference between

    keyword and reserve word

    naming convention and naming rule

    what us self referential loops, abstract methods and abstract value

    similarity between constructor and method

  34. Thanks a lot. Really helpful. Finally helped me build
    confidence. 🙂

  35. great…..amazing…is ko ratt daala to viva jhinga lala….hehehe.superb work.hope isi tarah theory ke bhi questions is website par aa jaye***

  36. btw heard that the viva questions will be based solely on the program u attempted

    ??

  37. good effort done, thank you 🙂

  38. Thanks…really helpful.

  39. Thanks a lot :DD

  40. U r doing a great job!!!

  41. it is very helpful!! gave me confidence,a bit.. programs also seem probable!! thanks a ton!

  42. Thanks a lot for this! Super helpful!

  43. Wowowow, that’s was completely amazing, Thank you dude, you are doing a great work , you helped me a lot during these days, and i am sure, lots of student will be benefited with this great information, thanks, but one request can you provide a post on Algorithm? Exam is on 20, if possible please provide it before the exam so that i along with many student can prepare for it… Thanks… 😉

  44. it is really very helpful…… thanx a lot…..!

  45. Sir,does Stack-Queue programming come in practicals??Are viva-questions asked on other than our chosen program question?

    • Hello Shivani,
      No stack and queues question don’t come in the program. But yes program which may require some similar concept may come.
      Most of the time questions are based on your chosen program. Very rarely do questions come out of that.

  46. Thanks alot, its really helpful…

  47. It was a great help

    thanx a lot..

  48. Thank you so much

  49. Thanks so much for this!

Leave a Reply to Animesh Cancel reply

Your email address will not be published. Required fields are marked *