0% found this document useful (0 votes)
42 views3 pages

Besic Synthetical Constructor in Java

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views3 pages

Besic Synthetical Constructor in Java

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Besic synthetical constructor in java

Features of java:-
List any eight features of Java.
Features of Java:
1. Data Abstraction and Encapsulation
2. Inheritance
3. Polymorphism
4. Platform independence
5. Portability
6. Robust
7. Supports multithreading
8. Supports distributed applications
9. Secure
10. Architectural neutral
11. Dynamic
Describe any four features of Java.
(Note: Any four features shall be considered)
Features of Java:
i. Java is an object oriented language:- It follows all the principles of
object oriented programming namely inheritance, polymorphism
and abstraction. Multiple inheritance is possible with the concept
of interface
ii. Java is both compiled and interpreted:- Most of the programming
languages either uses a compiler or an interpreter. Java programs
are to be compiled to get an intermediate byte code (a .class file)
and then interpreted making it more secure and platform
independent.
iii. Java is secure:
 Java does not use pointer.
 Java programs run inside a virtual machine
 Classloader adds security by separating the package for the
classes of the local file system from those that are imported
from network sources
 Bytecode Verifier checks the code fragments for illegal code
that can violate access right to objects
 Security Manager determines what resources a class can access
such as reading and writing to the local disk
iv. Robust: Java uses strong memory management. The lack of
pointers avoids security problem. There is automatic garbage
collection in java. There is exception handling and type checking
mechanism in java
v. Architecture-neutral: There is no implementation dependent
features e.g. size of primitive types is fixed
vi. Platform independent and Portable: java byte code can be carried
to any platform
vii. Distributed: Distributed applications can be created in java. RMI
and EJB are used for creating distributed applications. We may
access files by calling the methods from any machine on the
internet
viii. Multithreaded: A thread is like a separate program, executing
concurrently. We can write Java programs that deal with many
tasks at once by defining multiple threads. The main advantage of
multi-threading is that it doesn't occupy memory for each thread. It
shares a common memory area. Threads are important for multimedia,
Web applications etc.
Class: A class is a user defined data type which groups data
members and its associated functions together.
Object: It is a basic unit of Object Oriented Programming and
represents the real life entities. A typical Java program creates
many objects, which as you know, interact by invoking methods.

Java tokens

all primitive data types available in Java with their


storage sizes in bytes.
Sr.no Type Keyword Width(bytes)
1 long integer long 8
Short integer short 2
Integer int 4
Byte byte 1
2 Double double 8
Float float 4

3 Character char 2

4 Boolean Boolean 1 bit

Array:An array is a homogeneous data type where it can hold only


objects of one data type.
Types of Array:
1)One-Dimensional
2)Two-Dimensional
Two-Dimensional array:- An array is a collection of similar type of elements that have a
contiguous
memory location. Array is an object which contains elements of a similar
data type.
Two – dimensional array is the simplest form of a multidimensional array.
Syntax:
data_type[][] array_name = new data_type[x][y];
For example:
int[][] arr = new int[2][3];
Initialization
array_name[row_index][column_index] = value;
For example: arr[0][0] = 1;
Representation of 2D array in Tabular Format: A two – dimensional array
can be seen as a table with ‘x’ rows and ‘y’ columns where the row number
ranges from 0 to (x-1) and column number ranges from 0 to (y-1). A two –
dimensional array ‘x’ with 3 rows and 3 columns is shown below:

for eg.
class Twodarray
{
public static void main(String[] args)
{
int[][] arr = { { 1, 2 }, { 3, 4 } };
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
System.out.print(arr[i][j] + " ");
}
System.out.println();
}
}
}
Output:
12
34

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy