why we r not use pointers in corejava?
Answers were Sorted based on User's Feedback
Answer / arun
First you need to understand the concept of Pointer.
Pointer in C++, gives as reference to object from outside.
if we provide same thing in java, the concept of
Encapsulation will be violate. so java doesn't provide this
feature till 6.0 version. Recently Java added this feature
in java7.0. but they gave different name Clouser, which
give you pointer to function, as Callback in C...
| Is This Answer Correct ? | 15 Yes | 5 No |
Answer / javac
Internally java is based on pointers only.Sun People have
implemented the java utilites using pointer concepts but
they have restricted the developers to use the pointers.so
we cannot use pointers in java.
| Is This Answer Correct ? | 5 Yes | 4 No |
Explain notifyall() method of object class ?
Can sleep() method causes another thread to sleep?
What is immutability in java?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
What is the immediate superclass of the Dialog class?
How can we find size of the object ?
What is thread?
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
Does a class inherit the constructor of its super class?if it does, how can you hide that constructor? if it doesnot how can you call it from the sub class?
What is a stringbuffer?
Define the term string pool?
What is meant by inheritance and what are its advantages?