Very Short Questions Fall 2016 || Object-Oriented Programming

Very Short Questions Fall 2016

Very Short Questions Fall 2016

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

1. Define the given keywords in nutshell: JDK and JRE.

ANS- The Java Runtime Environment (JRE), also known as Java Runtime, is the part of the Java Development Kit (JDK) that contains and orchestrates the set of tools and minimum requirements for executing a Java application. The JDK, along with the Java Virtual Machine (JVM) and the JRE, can be used by developers to program and run Java applications.

2. List out the features of Java.

ANS- Generally, Java is a simple, robust and secure programming language. Here are the most important features of Java:

  • Java is Simple
  • The Java programming language is easy to learn
  • Java code is easy to read and write
  • Java is Familiar

3. List java’s primitive data types.

ANS- Primitive Data types in java are those data types that specify the type and size of data but does not provide any additional methods. Primitive data types available in java include

  • byte
  • short
  • int
  • char
  • long
  • float, etc

4. What is the scope of a variable?

ANS- Scope of a variable is the part of the program where the variable is accessible. In Java, all identifiers are lexically (or statically) scoped, i.e.scope of a variable can determined at compile-time and independent of the function call stack. Java programs are organized in the form of classes. Every class is part of some package.

5. List out the uses of the super keyword.

ANS- Usage of Java super Keyword are:

  • super can be used to refer to immediate parent class instance variable.
  • super can be used to invoke the immediate parent class method.
  • super () can be used to invoke the immediate parent class constructor.

6. List the types of access modifier available in java.

ANS- There are four types of access modifiers available in java:

  • Default – No keyword required
  • Private
  • Protected
  • Public

7. Difference between String Builder and String Buffer.

ANS-

Sr. No. Key String Buffer String Builder
1 Basic StringBuffer was introduced with the initial release of Java It was introduced in Java 5
2 Synchronized It is synchronized It is not synchronized

8. What is the purpose of the Simple Date Format class?

ANS- The SimpleDateFormat is a concrete class for formatting and parsing date which inherits java.text.DateFormat class. Notice that formatting means converting date to string and parsing means converting string to date.

9. What is the two feature of java that supports reusability?

ANS- The two feature of java that supports reusability are:

  • Robust
  • Platform Independent

10. The list life cycle of Thread.

ANS- The life cycle of thread is Born state, Ready state, Running state, Blocked State, Sleep, Dead. The number of threads can share an address space, open files and other resources. Same as the number of the process can share physical memory, disks, printers and the other resources. Because threads have some of the properties of the process.

You may also like Pokhara University, 2016 Fall Object Oriented Language

Be the first to comment

Leave a Reply

Your email address will not be published.


*