Very Short Questions Fall 2017 || Object-Oriented Programming

Very Short Questions Fall 2017

Very Short Questions Fall 2017

The answers to Very Short Questions Fall 2017 are given below:

1. What is the byte code? Explain.

ANS- Bytecode is the result of compiling source code written in a language that supports this approach. Most computer languages, such as C and C++, require a separate compiler for each computer platform – that is, for each computer operating system and the hardware set of instructions that it is built on.

2. Why java is known as platform independent language? Explain.

ANS- Java is platform-independent because it can work in any OS like Mac, Linux and Windows. Another reason the makes Java a Platform independent language is the elimination of undefined or architecture dependent constructs. Therefore java is called a platform-independent language.

3. Why package is an important concept in java?

ANS- The package is important because it helps to order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations and annotations easier, etc.

4. What is the use of the final keyword in java?

ANS- Final keyword in Java has three different uses:

  • create constants
  • prevent inheritance
  • prevent methods from being overridden.

5. List primitive data types available in java.

ANS- The primitive data types available in java are:

  • Int
  • Boolean
  • Double
  • Float

6. Define Wrapper class with example.

ANS- A wrapper is just some smallish class whose purpose is to provide a different interface than the thing it wraps. For example, it is common to take a C API and write one or more classes that “wrap” it to provide an object-oriented interface rather than a procedural one.

7. In java “String objects are immutable”. Explain.

ANS- In java, string objects are immutable. Immutable simply means unmodifiable or unchangeable. Once a string object is created its data or state can’t be changed but a new string object is created.

8. What is thread priorities. List different priorities values.

ANS- In the Java programming language, every thread has a priority. By default, a thread inherits the priority of its parent thread. You can increase or decrease the priority of any thread with the setPriority method.

9. What is the purpose of the Date class?

ANS- The class Date represents a specific instant in time, with millisecond precision. The Date class of java.util package implements Serializable, Cloneable and Comparable interface. It provides constructors and methods to deal with date and time with java.

10. List the way of handling exception in java.

ANS- Java Exception handling is done by five keywords:

  • try
  • catch
  • throw
  • throws
  • finally

You may also like Pokhara University || Fall 2017 || Object Oriented Programming || BBA/ BCIS

Be the first to comment

Leave a Reply

Your email address will not be published.


*