Sunday, October 14, 2007

JAVA QUESTIONS1

JAVA QUESTIONS


1. ODBC Ans. Open Database Connectivity.
2. HTML Ans. Hyper Text Markup Language
3. RISC Ans. Reduced Instruction Set Computing
4. ASCII Ans. American Standard Code For Information Interchange
5.ANSI Ans. American National Standard Institute.
6. XML Ans. Extended Markup Language
7. FLOPS Ans. Floating Point Operating Per Second
8. SQL Ans. Sequential Query Language
9. QBE Ans. Query By Example
10. ALE Ans. Address Latch Enable
12. RPC Remote procedure call
11. What is lagging in DBMS ? Ans. Reduced Redundancy.


What is JAVA ?

Java is a pure object oriented programming language, which has derived C syntax and C++ object oriented programming features.
Is a compiled and interpreted language and is platform independent and
Can do graphics, networking, multithreading. It was initially called as OAK.

What r the four cornerstones of OOP ?

Abstraction :
Can manage complexity through abstraction. Gives the complete overview of a particular task and the details are handled by its derived classes. Ex : Car.
Encapsulation : Nothing but data hiding, like the variables declared under private of a particular class are accessed only in that class and cannot access in any other the class.
Inheritance : Is the process in which one object acquires the properties of another object, ie., derived object.
Polymorphism : One method different forms, ie., method overriding and interfaces are the examples of polymorphism.

what is downcasting ?

Doing a cast from a base class to a more specific class. The cast does not convert the object, just asserts it actually is a more specific extended object.
e.g. Dalamatian d = (Dalmatian) aDog;
Most people will stare blankly at you if you use the word downcast. Just use cast.

What is Java Interpreter ?

It is Java Virtual Machine. ie., a java program compiles the Unicode to intermediary code called as Bytecode which is not an executable code. that is executed by Java interpreter.

What are Java Buzzwords ?

Simple : Easy to learn.
Secure : Provided by firewalls between networked applications.
Portable : Can be dynamically downloaded at various platforms connect to internet.
OOP : Four Corner stones.
Multithread : Can perform more than one task concurrently in a single program.
Robust : overcomes problems of de-allocation of memory and exceptions.
Interpreted : Convert into byte code and the executes by JVM.
Distributed : Concept of RMI.
Dynamic : Verifying and accessing objects at run time.


What are public static void main(String args[]) and System.out.println() ?

Public keyword is an access specifier.
Static allows main() to be called without having to instantiate a particular instance of class.
Void does not return any value.
main() is the method where java application begins.
String args[] receives any command line arguments during runtime.

System is a predefined class that provides access to the system.
out is output stream connected to console.
println displays the output.

What are identifiers and literals ?

Identifiers are the variables that are declared under particular datatype.
Literals are the values assigned to the Identifiers.

What is Typed language ?

This means that the variables are at first must be declared by a particular datatype whereas this is not the case with javascript.

Scope and lifetime of variables ?

scope of variables is only to that particular block
lifetime will be till the block ends.
variables declared above the block within the class are valid to that inner block also.

Casting Incompatible types ?

Can be done either implicitly and explicitly. ie., int b = (int) c; where c is float.
There are two types of castings related to classes : 1) unicast and 2)multicast.

Declaration of Arrays ?

int a[] = new int[10]; int a[][] = new int[2][2];

What does String define ?

String is an array of characters, but in java it defines an object.
and the variable of type string can be assigned to another variable of type String.

What r bitwise operators and bitwise logical operators ?

~, &, |, ^, >>, >>>, <<, &=, != and ~, &, | How do you define break and Label ? We can declare as break

No comments: