About Me

My photo
"Practise makes man Perfect" My Advice is :No need special books for java.. ok

Wednesday, 13 April 2011

What is JDK,JVM,JRE?

JDK:  Java Development Kit contains tools needed to develop java programs.


the tools are(JAVAC.EXE-compiller, JAVA.EXE-application launcher),applet viewer  etc.

JRE: 
JRE=JVM+Java packages(util,math,lang,awt,swing...)


JRE contains JVM, class libraries, and other supporting files.It does not contain any development tools such as compiler . Actually JVM runs the program, and it uses the class libraries, and other supporting files provided in JRE.


If you want to run any java program, you need to have JRE installed in the system


JVM:
           When we compile a JAVA File, output is not an '.exe' but it's a '.class' file consist of 
Java Byte Codes Which are understandable by JVM. JVM Inteprets the bytecodes into the machine code depending on operating system and hardware combination. It is responsible for all the things like garbage collection, array bounds checking.


Save as Draft

Why we do set the CLASSPATH and PATH in JAVA? Is it must ?

PATH:     Actually The Path variable set in java for locate Exicutable Files. as like JAVAC.EXE,JAVADOC.EXE,JAVA.EXE Or .Bat (batch files)   so on..,.

Ok ..

It is not manditory to set PATH in "Environmental Variable"..
 We Can also set PATH at runtime also..K..like this
 

C:\Program Files\Java\jdk1.6.0\bin\javac MyClass.java


       NOTE: We are locating .EXE files related to compiller.. Ok....


But the advantage of set PATH as Perminant is While we rebooting the System ,then no need to again set
the Path..Ok..


CLASS PATH:      We keep all jar files and class files in classpath variables..
It consist all .JAR files or .CLASS files

C:> set CLASSPATH=




                 

How internally program exhicutes in JAVA?


What is the output of this program??

class Sun
{
}

Java


  1. What is garbage collection? What is the process that is responsible for doing that in java? - Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process
  2. What kind of thread is the Garbage collector thread? - It is a daemon thread.
  3. What is a daemon thread? - These are the threads which can run without user intervention. The JVM can exit when there are daemon thread by killing them abruptly.
  4. How will you invoke any external process in Java? - Runtime.getRuntime().exec(….)
  5. What is the finalize method do? - Before the invalid objects get garbage collected, the JVM give the user a chance to clean up some resources before it got garbage collected.
  6. What is mutable object and immutable object? - If a object value is changeable then we can call it as Mutable object. (Ex., StringBuffer, …) If you are not allowed to change the value of an object, it is immutable object. (Ex., String, Integer, Float, …)
  7. What is the basic difference between string and stringbuffer object? - String is an immutable object. StringBuffer is a mutable object.
  8. What is the purpose of Void class? - The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void.
  9. What is reflection? - Reflection allows programmatic access to information about the fields, methods and constructors of loaded classes, and the use reflected fields, methods, and constructors to operate on their underlying counterparts on objects, within security restrictions.
  10. What is the base class for Error and Exception? - Throwable
  11. What is the byte range? -128 to 127
  12. What is the implementation of destroy method in java.. is it native or java code? - This method is not implemented.
  13. What is a package? - To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability.
  14. What are the approaches that you will follow for making a program very efficient? - By avoiding too much of static methods avoiding the excessive and unnecessary use of synchronized methods Selection of related classes based on the application (meaning synchronized classes for multiuser and non-synchronized classes for single user) Usage of appropriate design patterns Using cache methodologies for remote invocations Avoiding creation of variables within a loop and lot more.
  15. What is a DatabaseMetaData? - Comprehensive information about the database as a whole.
  16. What is Locale? - A Locale object represents a specific geographical, political, or cultural region
  17. How will you load a specific locale? - Using ResourceBundle.getBundle(…);
  18. What is JIT and its use? - Really, just a very fast compiler… In this incarnation, pretty much a one-pass compiler — no offline computations. So you can’t look at the whole method, rank the expressions according to which ones are re-used the most, and then generate code. In theory terms, it’s an on-line problem.
  19. Is JVM a compiler or an interpreter? - Interpreter
  20. When you think about optimization, what is the best way to findout the time/memory consuming process? - Using profiler
  21. What is the purpose of assert keyword used in JDK1.4.x? - In order to validate certain expressions. It effectively replaces the if block and automatically throws the AssertionError on failure. This keyword should be used for the critical arguments. Meaning, without that the method does nothing.
  22. How will you get the platform dependent values like line separator, path separator, etc., ? - Using Sytem.getProperty(…) (line.separator, path.separator, …)
  23. What is skeleton and stub? what is the purpose of those? - Stub is a client side representation of the server, which takes care of communicating with the remote server. Skeleton is the server side representation. But that is no more in use… it is deprecated long before in JDK.
  24. What is the final keyword denotes? - final keyword denotes that it is the final implementation for that method or variable or class. You can’t override that method/variable/class any more.
  25. What is the significance of ListIterator? - You can iterate back and forth.
  26. What is the major difference between LinkedList and ArrayList? - LinkedList are meant for sequential accessing. ArrayList are meant for random accessing.
  27. What is nested class? - If all the methods of a inner class is static then it is a nested class.
  28. What is inner class? - If the methods of the inner class can only be accessed via the instance of the inner class, then it is called inner class.
  29. What is composition? - Holding the reference of the other class within some other class is known as composition.
  30. What is aggregation? - It is a special type of composition. If you expose all the methods of a composite class and route the method call to the composite method through its reference, then it is called aggregation.
  31. What are the methods in Object? - clone, equals, wait, finalize, getClass, hashCode, notify, notifyAll, toString
  32. Can you instantiate the Math class? - You can’t instantiate the math class. All the methods in this class are static. And the constructor is not public.
  33. What is singleton? - It is one of the design pattern. This falls in the creational pattern of the design pattern. There will be only one instance for that entire JVM. You can achieve this by having the private constructor in the class. For eg., public class Singleton { private static final Singleton s = new Singleton(); private Singleton() { } public static Singleton getInstance() { return s; } // all non static methods … }
  34. What is DriverManager? - The basic service to manage set of JDBC drivers.
  35. What is Class.forName() does and how it is useful? - It loads the class into the ClassLoader. It returns the Class. Using that you can get the instance ( “class-instance”.newInstance() ).
  36. Inq adds a question: Expain the reason for each keyword of
    public static void main(String args[])

Tuesday, 12 April 2011

Tech Java Interview Question ?


Tech Interview JAVA QUESTIONS

  1. What is the difference between an Abstract class and Interface?
  2. What is user defined exception?
  3. What do you know about the garbage collector?
  4. What is the difference between java and c++?
  5. In an htm form I have a button which makes us to open another page in 15 seconds. How will you do that?
  6. What is the difference between process and threads?
  7. What is update method called?
  8. Have you ever used HashTable and Directory?
  9. What are statements in Java?
  10. What is a JAR file?
  11. What is JNI?
  12. What is the base class for all swing components?
  13. What is JFC?
  14. What is the difference between AWT and Swing?
  15. Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times ? Where three processes are started or three threads are started?
  16. How does thread synchronization occur in a monitor?
  17. Is there any tag in htm to upload and download files?
  18. Why do you canvas?
  19. How can you know about drivers and database information ?
  20. What is serialization?
  21. Can you load the server object dynamically? If so what are the 3 major steps involved in it?
  22. What is the layout for toolbar?
  23. What is the difference between Grid and Gridbaglayout?
  24. How will you add panel to a frame?
  25. Where are the card layouts used?
  26. What is the corresponding layout for card in swing?
  27. What is light weight component?
  28. Can you run the product development on all operating systems?
  29. What are the benefits if Swing over AWT?
  30. How can two threads be made to communicate with each other?
  31. What are the files generated after using IDL to java compiler?
  32. What is the protocol used by server and client?
  33. What is the functionability stubs and skeletons?
  34. What is the mapping mechanism used by java to identify IDL language?
  35. What is serializable interface?
  36. What is the use of interface?
  37. Why is java not fully objective oriented?
  38. Why does java not support multiple inheritance?
  39. What is the root class for all java classes?
  40. What is polymorphism?
  41. Suppose if we have a variable 'I' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
  42. What are virtual functions?
  43. Write down how will you create a Binary tree?
  44. What are the traverses in binary tree?
  45. Write a program for recursive traverse?
  46. What are session variable in servlets?
  47. What is client server computing?
  48. What is constructor and virtual function? Can we call a virtual function in a constructor?
  49. Why do we use oops concepts? What is its advantage?
  50. What is middleware? What is the functionality of web server?
  51. Why is java not 100% pure oops?
  52. When will you use an interface and abstract class?
  53. What is the exact difference in between Unicast and Multicast object? Where will it be used?
  54. What is the main functionality of the remote reference layer?
  55. How do you download stubs from Remote place?
  56. I want to store more than 10 objects in a remote server? Which methodology will follow?
  57. What is the main functionality of Prepared Statement?
  58. What is meant by Static query and Dynamic query?
  59. What are Normalization Rules? Define Normalization?
  60. What is meant by Servelet? What are the parameters of service method?
  61. What is meant by Session? Explain something about HTTP Session Class?
  62. In a container there are 5 components. I want to display all the component names, how will you do that?
  63. Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
  64. Tell some latest versions in JAVA related areas?
  65. What is meant by class loader? How many types are there? When will we use them?
  66. What is meant by flickering?
  67. What is meant by distributed application? Why are we using that in our application?
  68. What is the functionality of the stub?
  69. Explain about version control?
  70. Explain 2-tier and 3-tier architecture?
  71. What is the role of Web Server?
  72. How can we do validation of the fields in a project?
  73. What is meant by cookies? Explain the main features?
  74. Why java is considered as platform independent?
  75. What are the advantages of java over C++?
  76. How java can be connected to a database?
  77. What is thread?
  78. What is difference between Process and Thread?
  79. Does java support multiple inheritance? if not, what is the solution?
  80. What are abstract classes?
  81. What is an interface?
  82. What is the difference abstract class and interface?
  83. What are adapter classes?
  84. what is meant wrapper classes?
  85. What are JVM.JRE, J2EE, JNI?
  86. What are swing components?
  87. What do you mean by light weight and heavy weight components?
  88. What is meant by function overloading and function overriding?
  89. Does java support function overloading, pointers, structures, unions or linked lists?
  90. What do you mean by multithreading?
  91. What are byte codes?
  92. What are streams?
  93. What is user defined exception?
  94. In an htm page form I have one button which makes us to open a new page in 15 seconds. How will you do that?

Test ?

Test Paper :3
Paper Type : General - Interview
Test Date : 30 April 2007
Test Location : Dell Mohali
Posted By : Sweety

DELL PAPER ON 30th APRIL

THIS IS A PLACEMENT PAPER AS WELL AS PATTERN FOR INTERVIEW AT DELL (MOHALI) FOR TECHNICAL SUPPORT AS WELL AS CUSTOMER CARE POSITION

There are 5 round and all of them are elimination rounds so be careful!!!!

1.INTRODUCTION-This wil be a 15 minutes or 10 minutes round depending on the interviewer choice . the interviewer can ask you following questions:

a.Tel me something about yourself
if you have mentioned certain hobbies prepare some topics on those hobbies because they will ask you about them for example if you said during te interview that my hobbies is to read books....then prepare central idea of that particular book which you read because they will definatly peep more into your hobbies..etc

b.what did you leave your previous company (if you are working)
-in case you want to join technical support say "sir.i have an aptitude for computers .i always wanted to be in a technical support line..it wil be a learning experience for meso i left my old company" remember never give any bad point of your previous company to them...this may throw you out

c.why do you want to join dell?
a-Dell is a captive cal centre.it is a brand name. it has excellent growth opportunities and i always want to join a company with which i can grow. besides that i have heard from my friends about great working environment of dell.it wil be a great learning experience as well as privelage to join dell.

d.tel me about an experience with an irated customer........if you have worked somewhere before

note-the following questions can be asked for people who want to apply for technical support positions BE CAREFUL!!!!
while giving technical interview donot mention technical things of which you donot have any technical knowledge . just donot try to act oversmart speak that much which you know

e.CAN YOU TEL ME CONFIGURATION OF YOUR COMPUTER? FOR TECH SUPPOT PEOPLE
f.WHY WE USE A HEAT SINK IN COMPUTER?
g.WHAT IS UPS (UNINTERRUPTABLE POWER SUPPLY)?
h.you should also be prepared with some knowledge about dell
i.what do you know about dell

SOME GYAN ABOUT DELL
some big names, Michael DELL-the founder CEO AND CHAIRMEN of dell inc
ROMI MALHOTRA-director of dell india operations

dell is a trusted and diversified information technology suppliert and partner in employing 65200 employess worldwide working toward selling a comprehensive portfolio of products and services to customers worldwide.Dell is recognized br Fortune magazine as America's most admired company and no 3 globaly,designs,builds and delievers innovative,tailoredsystems that provide customers with exceptional value.Cmpany revenues for the last four quarters were $54.2 billion
Dell India Pvt Limited was incorporated in 1996.Dell's direct operations in india started in ht e year 2000 from banglore.Ever since its launch in india,Dell India has been groing at a tremendous pace

2.GROUP DISCUSSION
In this round ur interview will be taken again by some other person for 15 or more minutes and you will be accessed on your confidence level in a group and always smile while giving the interview .the questions will be almost same as in the first round

NOTE-In both these rounds they check your ACCENT (it should be neutral no mother tongue influence in it {MTI}) AND also check your grammer skills

CTS in Q


1. Some children goto ice-cream shop. 9 flavours are available there.
Each child takes a cone with two different flavours. No two children
take same combination and they have taken all such possible
combinations. How many children went to ice cream shop?
2. (1- 1/6) (1-1/7) .... (1- (1/(n+4))) (1-(1/(n+5))) = ?
Ans: 5/(something)
3. A man has to get air-mail. He starts to go to airport on his motor
bike. Plane comes early and the mail is sent by a horse-cart. The
man meets the cart in the middle after half an hour. He takes the
mail and returns back, by doing so, he saves twenty minutes. How
early did the plane arrive?
4. A,B,C,and D tells the following times by looking at their watches.
A tells it is 3 to 12.
B tells it is 3 past 12.
C tells it is 12:2.
D tells it is half a dozen too soon to 12.
No two watches show the same time. The differences between the
watches is 2,3,4,5 respectively. Whose watch shows maximum time?
5. y
/ |
/ |
/ |
C /-------|D
/ \ /|
/ \ / |
/ \ / |
------------
X B
It is semicircle along X and Y with radius=17. What is length of BD?
6. Ten boxes are there. Each ball weighs 100 gms. One ball is
weighing 90 gms.
i) If there are 3 balls (n=3) in each box, how many times will it
take to find 90 gms ball?
ii) Same question with n=10
iii) Same question with n=9
7. There are three different boxes A,B and C. Difference between
weights of A and B is 3 kgs. And between B and C is 5 kgs. Then what
is the maximum sum of the differences of all possible combinations
when two boxes are taken each time.
8. I lost Rs.68 in two races. My second race loss is Rs.6 more than
the first race. My friend lost Rs.4 more than me in the second race.
What is the amount lost by my friend in the second race?
Ans: 37 (check it)
9. A problem on weather. I don't remember exactly, but its something
like this. We went to some place and it rained for 15 days. Clear
mornings are followed by rainy afternoons. And all clear afternoons
are preceeded by rainy mornings. It rained continuiosly for 10
mornings. It rained for 12 afternoons. And 13 days are without any
rain. How many days we stayed in the new place?
10. A and B are shooters and having their exam. A and B fall short of
10 and 2 shots respectively to the qualifying mark. If each of them
fired atleast one shot and even by adding their total score together,
they fall short of the qualifying mark, what is the qualifying mark?
11. A face of the clock is divided into three parts. First part hours
total is equal to the sum of the second and third part. What is the
total of hours in the bigger part?
12. A INK bug starts jumping 1 mtr to each direction north, south,
east and west respectively. It marks a point in the new locations. It
comes back to its original point after jumping in all directions. It
again starts the same process from the newly drawn unique points.
Totally how many points did the bug mark?
13. There is a six digit code. Its first two digits, multiplied by 3
gives all ones. And the next two digits multiplied by 6 gives all
twos. Remaining two digits multiplied by 9 gives all threes. Then
what is the code?
14. There are 4 balls and 4 boxes of colours yellow, pink, red and
green. Red ball is in a box whose colour is same as that of the ball
in a yellow box. Red box has green ball. In which box you find the
yellow ball?
Ans: Pink
15. Quitub Meenar height is 230 mtrs. A person lays a boulder and
stands on it. He then places a step by its side. Then he goes for
another boulder on it and so on. One step height is 1 mtr. Boulder is
one cubic mtr. Then how many steps are required to reach to the top?
16. A question on quadrilateral. Ans: 20cm sq.
17. A problem on Parallelogram.
18. There are four professors: American, English, Japanese and
Indian. Each take only one subject and all their houses are in a
straight line. Indian doesn't teach maths. American teaches
geography. English man is adjacent to Japanese who is in red house.
Professor in green house teaches history. Indian lives in white
house. Blue house has only one adjacent house which is green. (one
more subject is phylosophy).
Two or Three questions on this, like what does the Indian teach, etc..
20. A similar question, 4 persons (Vijay, Vinay, Ajay and Nanda) in 4
professions: medical, engineering, architecture, and Accountancy.
Each play one different instrument : Sitar, Tabla, Violin and Flute.
There are some conditions and two questions on this. Its easy, just
need to understand the problem.
21. Two tribes of Jadugars are there. One type is always right about
predictions about themselves and others. Another type is always wrong
in their predictions about themselves and others.
Two questions like:
if a jadugar tells 'you are always right' to a man, to which type the
man and the jadugar belong to?
23. Ambanis took over some company. Later they came to know that the
co. was actually in loss. They have learned that ________
four options like:
All that glitters is not gold (I think this option is correct)
24. One more question like the one above.
25. Two questions are given, and some common sense is needed there,
for example,
After 180 successful days, 'News Talk' is taken out of air. The
government wants to woo the journalists before the general elections.
Mr.X of DD says that the program is not completely stopped and it is
just getting reformatted.
Question is 'What is News talk'?
i) A program on govt. issues
ii) A serial on journalists (I think it is right)
iii) A documentary on journalism
iv) Something else
Paper is not that difficult, you just need to chose ur strenth and
answer those questions first. Each right answer +1, wrong answer, -
0.25. In our campus, persons who attempted 10 questions also got thru
the written test. So the cut-off is very less.
Interview was very simple, some questions on C ( test ur c skills is
more than enough) and some questions on your area of interest. Some
puzzles were also asked. But it is more like a mere formality. The
interview panel was very co operative and it was a very good
experience.
ALL THE BEST!!!