09-06-2012, 12:13 PM
question for computer
question for computer.pdf (Size: 307.5 KB / Downloads: 0)
What is meant by Object Oriented Programming?
Ans:OOP is a method of programming in which programs are organised as
cooperative collections of objects. Each object is an instance of a class
and each class belong to a hierarchy.
What is a Class?
Ans:Class is a template for a set of objects that share a common
structure and a common behaviour.
What is an Object?
Ans:Object is an instance of a class. It has state,behaviour and identity. It
is also called as an instance of a class.
What is an Instance?
Ans:An instance has state, behaviour and identity. The structure and
behaviour of similar classes are defined in their common class. An
instance is also called as an object.
What do you mean by Patform independence?
Anslatform independence means that we can write and compile the java
code in one platform (eg Windows) and can execute the class in any other
supported platform eg (Linux,Solaris,etc).
What is Byte code?
Ans:Byte code is a set of instructions generated by the compiler. JVM
executes the byte code.
How does Java acheive platform independence?
Ans:A Java source file on compilation produces an intermediary .class
rather than a executable file. This .class file is interpreted by the JVM.
Since JVM acts as an intermediary layer.
What is a pointer and does Java support pointers?
Ansointer is a reference handle to a memory location. Improper
handling of pointers leads to memory leaks and reliability issues hence
Java doesn't support the usage of pointers.
What are the good programming practices for better memory
management?
Ans:a. We shouldn't declare unwanted variables and objects.
b. We should avoid declaring variables or instantiating objects inside
loops.
c. When an object is not required, its reference should be nullified.
d. We should minimize the usage of String object and SOP's.