Java Introduction FAQ


Java Introduction FAQ

1) What is Java?

2) What are the uses of Java?

3) What are the important features of Java?

4) How to setup Java Environment Setup in Windows Operating Environment?

5) What are the important Java Language Elements?

6) What are the fundamentals of OOPS?

7) Explain about Java Comments?

8) What are Java Modifiers?

9) What are Java Variables?

10) What are Operators?

11) What are Methods?

12) How to handle Strings in Java?

13) What is Array?

14) How to read input in Java?
-------------------------------------------------
1) What is Java?

• Java is a general purpose, high level Programming Language developed by Sun Microsystems and released in 1995, which was later acquired by the Oracle Corporation.

• Java can be used to create complete Software Applications that may run on a single computer or be distributed among servers and clients in a network.

• Java runs on a variety of platforms, such as MS Windows, Mac, and the various versions of UNIX.

• Object-orientated programming language, except the primitive data types, all elements in Java are objects.
-------------------------------------------------
2) What are the uses of Java?

Java is used to Develop,

• Desktop Applications (Ex: Acrobat Reader)

• Web Applications (Ex: snapdeal.com)

• Enterprise Application (Ex: Banking, Insurance Applications etc...)

• Mobile Applications

• Embedded Systems.

• Smart Cards

• Games Software 

• Scientific Applications

And Test Automation (with Selenium) Etc...

Note: Software development is the primary purpose of Java, secondary purpose is Test Automation.
-------------------------------------------------
3) What are the important features of Java?

i) Platform Independent

Java provides software-based platform, Java code can be run on multiple platforms e.g. Windows, 
Linux, Sun Solaris, Mac/OS etc.

ii) Robust

Robust means strong, Java uses strong memory management.

iii) Portable

We can carry the java bytecode to any platform.

iv) Object-oriented

Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance
 by providing some rules.

v) Simple

Java syntax is based on C++,  removed many confusing rarely-used features, and there is 
 Automatic Garbage Collection

High-performance, 

Distributed, 

Architecture-neutral 

and Multi-threaded Etc...
-------------------------------------------------
4) How to setup Java Environment Setup in Windows Operating Environment?

Setup Java Environment in order to write and execute Java programs.

Steps:

• Download Java Software (JDK) and Install.

• Set Environment Variable (Path Variable).

Write Java programs using Notepad as Editor, Compile the Programs and Run.

Or

• Download Java Software (JDK) and Install.

• Download Eclipse IDE and Extract.

Write Java Programs in Eclipse IDE Editor and Run
---------------------------------------------------------------
5) What are the important Java Language Elements?

Java Language Elements

• Comments
• Data Types
• Modifiers
• Variables
• Operators
• Flow Control
Condtional Statements
Loop Statements
• Strings
• Arrays
• IO and File handling
• Methods
Predefined
User defined
Etc...
-------------------------------------------------
6) What are the fundamentals of OOPS?

Four Fundamentals of Object Oriented Programming,
i) Inheritance
ii) Polymorphism
iii) Abstraction
iv) Encapsulation
-------------------------------------------------
7) Explain about Java Comments?

Comments are English words used for Code documentation

Purpose of Comments
a) To make the code Readable
b) To make the code disable from Execution

Comments Syntax in Java

Java supports Single line comment and multiple line comment.

a) Use // for Single line comment

b) Use /*..........
------------
----------
----------
-------------*/ for multiple line comment

8) What are Java Modifiers?

Modifiers are keywords that we add to those definitions to change their meaning.

Two types of Modifiers in Java

a) Access Modifiers


b) Non Access Modifiers
-------------------------------------------------
9) What are Java Variables?

Variable: A named memory location to store the temporary data within a program.

We have Three Types of Variables in Java

i) Local Variables
Local variables are declared in methods or blocks.

ii) Instance Variables
Instance Variables are declared in a class but outside of a method or any block.

iii) Class / Static Variables

Static Variables are declared as static, these can't be local.
-------------------------------------------------
10) What are Operators?

Operators are used to perform mathematical, comparison and logical operations.

Categories of Operators in Java

a) Arithmetic Operators

b) Relational Operators

c) Assignment Operators

d) Logical Operators 
Etc...
-------------------------------------------------
11) What is Method in Java?

A Java Method is a set of statements that are grouped together to perform an operation.

Methods are also known as Functions.

In structured programming (Ex: C Language) we use Functions (Built-in and User defined)

In Object Oriented Programming (Ex: Java Language) we use Methods (Built-in and User defined)

Types Methods in Java

Two types of Methods

i) Built in /Pre-defined Methods

ii) User defined Methods
-------------------------------------------------
12) What is String?

String is a sequence of characters written in double quotes.

String may have Alphabets, Numbers, and Special Characters.

Example:

"India"
"123"
"India123"
"India*"
"india123&*"
-------------------------------------------------
13) What is Array?

In Java, Array is an Object that holds a fixed number of values of a single data type.

The length of Array is established when the Array is created.

Array length is fixed, index starts from Zero.
-------------------------------------------------
Java Tutorial
14) How to read input in Java?

There are three ways available in Java for Reading input.

i) Using Scanner

ii) Using DataInputStream

iii) Using BuffuredReader

Note: Using java.util.Scanner is the easier way and it includes many methods to check input is valid to read.
-------------------------------------------------

0 comments:

Post a Comment