You are on page 1of 6

Byte code?

Ans-The compiler converts the programme to a platform independent code called byte code.

What do you mean by Package?

Ans-collection of classes.

Why packages are used?

It used to prevent naming control and to make searching and usage of classes to easier.

What is Garbage collection?

Ans- The process of automatically declaration of memory is called garbage collection.

1. What do you understand by Java?

Java is an object-oriented computer language.


It is a high-level programming language developed by James Gosling in Sun Microsystem in
1995.
Java is a fast, secure and reliable language used for many games, devices and applications.
Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions
of UNIX.

Q: List any five features of Java?


A: Some features include Object Oriented, Platform Independent, Robust, Interpreted,
Multi-threaded

Q3. Why Java is platform independent?


Platform independent practically means “write once run anywhere”. Java is called so
because of its byte codes which can run on any system irrespective of its underlying
operating system.
2. What is the most important feature of Java?

Java is a platform independent language.

3. Outline the major Java features.


Object-Oriented – java is based on object-oriented programming where the class and
methods describe about the state and behaviour of object.
Portable – Java program gets converted into Java Byte Codes that can be executed on any
platform without any dependency.
Platform independent – java works on “write once and run anywhere” as it supports
multiple platforms like Windows, Linux, Mac, Sun Solaris, etc.
Robust – Java has a strong memory management as there is no pointer allocations. It has
automatic garbage collection that prohibits memory leaks.
Interpreted – java compiler converts the codes into Java Byte Codes which are then
interpreted and executed by Java Interpreter.
Multithreaded –it allow a programme repetatly execute multiple task by a thread .
4. What do you mean by Object?
Object is an instant of a class.
What is variable ?

It is used to store data or value which is use in java program .

Q: Define class?
A: A class is the charecterstic and behaviour of an object.

Q: What is a Local Variable


A: Variables defined inside methods, constructors or blocks are called local variables.

Q: What is a Instance Variable


A: Instance variables are variables within a class but outside any method.

Q: What is a Class Variable


A: These are variables declared with in a class, outside any method, with the static
keyword.
Q: What do you mean by Constructor?
A: Constructor gets called when a new object is created.

Q: What is the default value of byte datatype in Java?


A: Default value of byte datatype is 0.

Q: When a byte datatype is used?


A: This data type is used to save space in large arrays, mainly in place of integers, since
a byte is four times smaller than an int.

What is Array?
Ans- collection of an element of a single data type store in adjacent memory location .

5. What is class in Java?


Java encapsulates the codes in various classes which define new data types.
6. Differentiate between JDK, JRE and JVM.
JVM is responsible for executing java program of a computer .

JRE (Java Runtime Environment) putting a dicision of the Java Virtual Machine which
executes Java programs.

JDK (Java Development Kit) consists of JRE along with the development tools required to
write and execute a program.
Q: What is JAR file?
A: JAR files is Java Archive fles and it aggregates many files into one. It holds Java
classes in a library. JAR files are built on ZIP file format and have .jar file extension.

Q: What is a WAR file?


A: This is Web Archive File and used to store XML, java classes, and JavaServer pages.
which is used to distribute a collection of JavaServer Pages, Java Servlets, Java classes,
XML files, static Web pages etc.

Q: Define JIT compiler?


A: It improves the runtime performance of computer programs based on bytecode.
API= collection of software components such as class,methord etc.
Q. What are the principle concepts of OOPS?
There are four principle concepts upon which object oriented design and programming rest. They
are:
a) Abstraction
b) Polymorphism
c) Inheritance
d) Encapsulation
(i.e. easily remembered as A-PIE).

Q. What is Abstraction?
It refers to the ability to make a class abstract in OOP.Abstraction refers to the act of
representing essential features without including the background details or explanations.

Q. What is Encapsulation?
It is the technique of making the fields in a class private and providing access to the
fields via public methods. If a field is declared private, it cannot be accessed by anyone
outside the class,

Q. What is Inheritance?
Inheritance is the process by which objects of one class acquire the properties of objects of
another class.

Q. What is Polymorphism?
Polymorphism is the ability of an object to take on many forms.

8. Explain method overloading.


When a Java program contains more than one methods with the same name but different
properties, then it is called method overloading.
25. What is method overloading and method overriding?

Method overloading: When a method in a class having the same method name with different
arguments is said to be method overloading. Method overriding : When a method in a class having
the same method name with same arguments is said to be method overriding.

14. Difference between the Inner Class and Sub Class.

Inner Class   Sub Class

It’s a class which is nested within another class. It’s a class which inherits from
another class called super class.
Inner class provides the access rights for the class Sub-class provides access to all
which is nesting it and that can access all variables public and protected methods and
and methods defined in the outer class. fields of its super class.

24. Define Abstract class?


A class which contains the abstract keyword in its declaration is known as abstract class. It
can have abstract and non-abstract methods (method with body).
 This class can have public, private, protected or constants and default variables.
25. Describe the Annotations.
Java Annotations is a tag which symbolizes metadata associated with class, interface,
methods, fields, etc.
Q: Explain TreeSet?
A: It is a Set implemented elements in a sorted order.

Q:HarshSet?
A:Don’t duplicate the value store.

Q8. What is the difference between Array list and vector?

Array List Vector

Array List is not Vector is


synchronized. synchronized.

Array List is fast as


Vector is slow as it
it’s non-
is thread safe.
synchronized.

If an element is
inserted into the Vector defaults to
Array List, it doubling size of its
increases its Array array.
size by 50%.

Array List does not


Vector defines the
define the
increment size.
increment size.

Except Hashtable,
Array List can only Vector is the only
use Iterator for other class which
traversing an Array uses both
List. Enumeration and
Iterator.
What is WildCard?

The ? known as the wildcard in generic program .

What is array list?

It is searching an object in the list and inserting the object at the end of the list.

5. What is the base class of all classes?

java.lang.Object

9. What is the difference between superclass and subclass?

 A super class is a class that is inherited whereas sub class is a class that does the inheriting.

38. What are the functions of hashCode() method?


This method returns a hash code value (an integer number).
And also returns the same integer number, if two keys (by calling equals() method) are same.
But in sometimes two hash code numbers can have different or same keys.

Question 5- What do you mean by Java Applet?


Answer- An applet is a special kind of Java program that is designed to be
transmitted over the internet and automatically executed by a Java compatible
web browser .

Question 8-What do you mean by Multithreaded programming in Java?


Answer- A multithreaded program contains two or more parts that can run
concurrently. Each of these part is known as a thread which is the smallest unit of
dispatchable code. Each thread defines a separate path of execution.

Q: What do you mean by Multithreaded program?


A: A multithreaded program contains two or more parts that can run concurrently. Each
part of such a program is called a thread, and each thread defines a separate path of
execution.

12. What is synchronization?

Synchronization is the mechanism that ensures that only one thread is accessed the resources at a
time.

Q2. Explain public static void main(String args[]).


 public : Public is an access modifier, which is used to specify who can access
this method. Public means that this Method will be accessible by any Class.

 static : It is a keyword in java which identifies it is class based



 void : It is the return type of the method. Void defines the method which will
not return any value.

 main: It is the method where the main execution occurs.

 String args[] : It is the parameter passed to the main method.

 18. What is JDBC?
 JDBC is a set of Java API for executing SQL statements.

45. What is servlet?

Servlets are modules that extend request/response-oriented servers,

55. What is JSP?

JSP is a technology that returns dynamic content to the Web client using HTML, XML and JAVA
elements. JSP page looks like a HTML page but is a servlet.

 
56. What is the purpose of apache tomcat?

Apache server is a standalone server that is used to test servlets and create JSP pages.

What is CSS ?

Cascading Style sheets is a style sheet language used for describing the presentation of a document
written in a language like HTML.

What is cloud computing ?

It is a remotely serve on the internet to store , manage and process data than a personal computer.

What is angular JS ?

It is a structural frame work for a dynamic web apps.

What is JQuery?

It is a java script library as wel as CSS animation and AJAX.

What is AJAX?

It statnd for Asynchorise javascript and XML.

What is Vb.Net?

It is a object-orinted-programming language which implemented on the .NET framework.

What is SQL?
it is used in programming and designed for managing data held in RDMS(relational database
management system)

You might also like