Professional Documents
Culture Documents
One S'top Solution For All Your Educational and Technical Needs
One S'top Solution For All Your Educational and Technical Needs
com
One sTop solution for all your educational and technical needs
www.Technicalsymposium.com
Enhanced Reusability
Modular approach towards problem solving which will be
Better Maintainability
Better Performance if system is designed cautiously using OOAD concepts
www.Technicalsymposium.com
www.Technicalsymposium.com
diagrams, formerly called state chart diagrams in UML 1.x, describing how their
instances work.
What are different kinds of Structure diagrams?
Structure Diagrams as part of UML2.1:
Class diagrams
Object diagrams
Composite structure diagrams
Component diagrams
Deployment diagrams
Package diagrams
What are different kinds of Interaction diagrams?
The Interaction diagrams represent how objects interact with one another through
message passing.
There are two kinds of Interaction Diagrams :
Sequence Diagram
Collaboartion Diagram
If you want to study these diagrams in detail then go through given by
OMG.
What are different kinds of Behavior diagrams?
Behavior Diagrams include :
- Use Case Diagram (used by some methodologies during requirements
gathering)
- Activity Diagram
- State Machine Diagram.
What is a Java Virtual Machine (JVM)?
A Java Virtual Machine is a runtime environment required for execution of a Java
application.Every Java application runs inside a runtime instance of some
concrete implementation of abstract specifications of JVM.It is JVM which is crux
of 'platform independent' nature of the language.
What is a JVM consisted of?
Each time a Java Application is executed then an instance of JVM ,responsible for its
running,is created.A JVM instance is described in terms of subsystems, memory
areas, data types, and instructions.
What is a class loader and what is its responsibilities?
www.Technicalsymposium.com
The answer is 'No'.If the program is I/O bound or running in native methods, then the
VM is not involved in the consumption of CPU time. The VM technology will
engage CPU for running bytecodes. Typical examples of time spent not running
bytecode are graphical operations that make heavy use of native methods, and
I/O operations such as reading and writing data to network sockets or database
files.
What is the difference between interpreted code and compiled code?
An interpreter produces a result from a program, while a compiler produces a program
written in assembly language and in case of Java from bytecodes.The scripting
languages like JavaScript,Python etc. require Interpreter to execute them.So a
program written in scripting language will directly be executed with interpreter
installed on that computer,if it is absent then this program will not execute.While in
case of compiled code,an assembler or a virtual machine in case of Java is required to
convert assembly level code or bytecodes into machine level
instructions/commands.Generally, interpreted programs are slower than compiled
programs, but are easier to debug and revise.
Why Java based GUI intensive program has performance issues?
GUI intensive Java application mostly run underlying OS specific native libraries which
is time and more CPU cycles consuming.
The overall performance of a Java application depends on four factors:
The speed at which the libraries that perform basic functional tasks execute (in
native code)
The virtual machine is responsible for byte code execution, storage allocation, thread
synchronization, etc. Running with the virtual machine are native code libraries that
handle input and output through the operating system, especially graphics operations
through the window system. Programs that spend significant portions of their time in
those native code libraries will not see their performance on HotSpot improved as
much as programs that spend most of their time executing byte codes.
What is 64 bit Java ?
A 64-bit version of Java has been available to Solaris SPARC users since the 1.4.0
release of J2SE. A 64-bit capable J2SE is an implementation of the Java SDK (and the
JRE along with it) that runs in the 64-bit environment of a 64-bit OS on a 64-bit
processor. The primary advantage of running Java in a 64-bit environment is the larger
address space.
www.Technicalsymposium.com
This allows for a much larger Java heap size and an increased maximum number of
Java Threads, which is needed for certain kinds of large or long-running applications.
The primary complication in doing such a port is that the sizes of some native data
types are changed. Not surprisingly the size of pointers is increased to 64 bits. On
Solaris and most Unix platforms, the size of the C language long is also increased to
64 bits. Any native code in the 32-bit SDK implementation that relied on the old sizes
of these data types is likely to require updating.
Within the parts of the SDK written in Java things are simpler, since Java specifies the
sizes of its primitive data types precisely. However even some Java code needs
updating, such as when a Java int is used to store a value passed to it from a part of
the implementation written in C.
What is the difference between JVM and JRE?
A Java Runtime Environment (JRE) is a prerequisite for running Java applications on
any computer.A JRE contains a Java Virtual Machine(JVM),all standard,core java classes
and runtime libraries. It does not contain any development tools such as compiler,
debugger, etc. JDK(Java Development Kit) is a whole package required to Java
Development which essentially contains JRE+JVM,and tools required to compile and
debug,execute Java applications.
What are different datatypes in Java?
Java supports following 8 primitive datatypes:
(click this picture to enlarge)
iArr[0] = 20;
int var = 4 + 2; // var is now 6
A statement is complete unit of execution.Any expression which is :
An assignment expression
++ or --
Method invocation
Object creation
www.Technicalsymposium.com
www.Technicalsymposium.com
Java classes, interfaces, and their members can be declared with one or more
modifiers.They can be categorised as:
Class Modifiers :
ClassModifier: one of
public private(for inner classes) protected(for inner classes)
abstract static final strictfp
Any top level class can either be public or package private(no explicit modifier)
Field Modifiers
FieldModifier: one of
public protected private
static final transient volatile
Method Modifiers
MethodModifier: one of
public protected private abstract static
final synchronized native strictfp
Constructor Modifiers
ConstructorModifier: one of
public protected private
The following matrix of the all modifiers in Java shows which modifier maps to which
element:-
www.Technicalsymposium.com
www.Technicalsymposium.com
www.Technicalsymposium.com
This form is used when the assert statement has to provide a detail message for the
AssertionError.The system passes the value of Expression2 to the appropriate
AssertionError constructor, and this constructor uses the string representation of the
value as the error's detail message. This detail message helps in analysing and
diagnosing the assertion failure which ultimately helps in resolving the error.
super(msg);
}
What do you know about the garbage collector?
In Java, memory management is done automatically by JVM.A programmer is free of
this responsibility of handling memory. A garbage collector is a part of JVM responsible
for removing objects from heap, which is no longer in use. The garbage collector
typically runs in a background thread, periodically scanning the heap, identifying
garbage objects, and releasing the memory they occupy so that the memory is
available for future objects.
Why Java does not support pointers?
As per the design decision Java does not support pointers explicitly.This greatly
reduces the burden of dynamic memory management while coding from
programmers.Though programmers dynamically allocate memory while coding but
they need not worry about deallocating this memory.The automatic garbage collection
feature of Java collects dangling references of objects though it has a trade off on
performance as programmer managed memory management will be efficient as
compared to JVM driven automatic garbage collection.
Does garbage collection guarantee that a program will not run out of
memory?
Garbage collection does not guarantee that a program will not run out of memory. As
garbage collection is JVM dependent then It is possible for programs to use memory
resources faster than they are garbage collected.Moreover garbage collection cannot
be enforced,it is just suggested.Java guarantees that the finalize method will be run
before an object is Garbage collected,it is called by the garbage collector on an object
when garbage collection determines that there are no more references to the object.
The garbage collection is uncontrolled, it means you cannot predict when it will
happen, you thus cannot predict exactly when the finalize method will run. Once a
variable is no longer referenced by anything it is available for garbage collection.You
can suggest garbage collection with System.gc(), but this does not guarantee when it
will happen.
What is finally in Exception handling?
'finally' is a part of try-catch-throw and finally blocks for exception handling
mechanism in Java.'finally' block contains snippet which is always executed
irrespective of exception occurrence. The runtime system always executes the
statements within the finally block regardless of what happens within the try block.
The cleanup code is generally written in this part of snippet e.g. dangling references
are collected here.
www.Technicalsymposium.com
www.Technicalsymposium.com
www.Technicalsymposium.com
www.Technicalsymposium.com
www.Technicalsymposium.com