_Introduction to Java
3350703
Assignment-1
1: Explain Following terms:(i)Platform Independent (ii) Byte Code (iii) Applet (v) JVM (iv) JRE
Answer:-
b
2. Explain different features of Java.
Answer:-
Simple:-
Object Oriented:-
Distributed:-
Platform Independent:-
Architecture neutral:-
Multithreaded:-
Dynamic:-
Portable:-
The Byte code generated by java compiler can be used on any machine, so java is portable.
High Performance:-
Robust:-
Secure:-
Interpreted:-
3. Explain different OOP concepts.
Answer:-
-Encapsulation:-
It is a process of wrapping of data and methods in a single unit.
it is achieved in Java language by class concept.
The main advantage of using encapsulation is to secure the data from other methods.
-Inheritance:-
The process by which one object can use properties of another object is called inheritance.
Inheritance has feature in which we can reuse the code and hence it avoids to writing the same code again and again.
-Polymorphism:-
Polymorphism is the ability of an object to change its behavior according to how it is being used.
There are two types of Polymorphism 1) Compile time Polymorphism 2) Runtime Polymorphism.
-Abstraction:-
Abstraction separates specification from implementation of class.
It refers to act of representing essential features without including the background details.
4. Explain basic structure of Java programs.
Answer:-
5. Describe JVM (Java Virtual Machine).
Answer:-
JVM is a platform-independent execution environment that converts Java byte code into machine language and executes it.
The JVM is called "virtual Machine" because it provides a machine interface that does not depend on the underlying operating system and hardware architecture.
This independence supports the write-once run-anywhere concept of java programs.
Java Virtual Machine is a program that runs pre compiled Java programs, which mean JVM executes .class files and produces output.
6. Describe main() method in Java.
Answer:-
7. Explain why JAVA is known as platform independent language?
Answer:-
8. Write differences between Java and C++.
Answer:-
Java:-
Java does not support pointer unions and operator overloading and structure.
It support garbage collection.
It supports inheritance except multiple inheritance.
Java is interpreted.
Java does not supports Destructor.
C++:-
C++ supports pointer, unions, operator overloading and structure.
It does not supports garbage collection.
It supports inheritance including multiple inheritance.
C++ is compiled.
C++ supports Destructor.
0 Comments