Showing posts with label Java interview questions and answers. Show all posts
Showing posts with label Java interview questions and answers. Show all posts

Monday, July 16, 2012

the hot news

'Draft bill against manual scavenging with stricter provisions in monsoon session'



New Delhi : Even as actor-activist Aamir Khan Monday met Prime Minister Manmohan Singh to raise the age-old issue of manual scavenging the government said it is taking up the matter as "top priority" and a draft bill with stricter provisions on eradicating the dehumanising practise and rehabilitating the people involved is to be introduced in the monsoon session of parliament. According to Census 2011, there are around 700,000 manual scavengers in the country engaged in the task of removing and transporting night soil. Of these, 586,067 are in the rural areas and 2,08,323 in the urban areas. "Yes, we know it persists, and we are taking up this matter as top priority. The draft for the Prohibition of Employment as Manual Scavengers and Their Rehabilitation Bill, 2012 is under circulation to the concerned ministries and departments. We intend to introduce it in the monsoon session of parliament. Everything is in the process," Social Justice and Empowerment Minister Mukul Wasnik told IANS. "We are working out a survey of the manual scavengers in the country. Data on manual scavengers would be available soon," the minister added. Elaborating on the rehabilitation of scavengers, the minister said: "The rehabilitation scheme is being implemented through state channelizing agencies. Whenever a state government demands funds for rehabilitation programme, the amount will be sanctioned as per its proposal." According to Safai Karmachari Andolan (SKA), a voluntary organisation working for manual scavengers, the funds for rehabilitation have been almost tripled from Rs.1.36 crore (Rs.13.6 million) in 2007-08 to Rs.3.43 crore (Rs.34.3 mn) in 2010-11. Aamir Khan, who highlighted the issue in a recent episode of his popular television programme "Satyameva Jayate", met the prime minister and Wasnik over the issue Monday. Meanwhile, around 200 scavengers from across Maharashtra protested in Mumbai to demand an end to the pernicious practice. The protesters, led by a social group Campaign Against Manual Scavenging in Maharashtra, are demanding alternate and dignified jobs, decent housing and education. Highlighting their plight, Sumitra, a manual scavenger who hails from Nand Nagri, north Delhi, told IANS: "I don't have a choice. I'm at the absolute bottom of the society, the job came as a legacy. But I don't want my children to touch these baskets. During rains it is terrible doing this filthy job." According to the census, 23 lakh of the country's total population use dry or non-flush latrines and over a lakh defecate in open spaces. To government has enacted the Employment of Manual Scavengers and Construction of Dry Latrines (Prohibition) Act in 1993, according to which construction of dry latrines and employment of scavengers to clean it would invite imprisonment up to one year and a fine of Rs.2,000 or both. The Act has not been effectively implemented since its formulation 19 years ago. The National Advisory Council (NAC) headed by Congress president Sonia Gandhi had been stressing for years on the need to come up with a stricter law and Gandhi had also written to the prime minister in October 2010 to take immediate action. Stressing on the need for a stronger law, former NAC member Harsh Mander told IANS: "The 1993 law is weak, it needs to be replaced. The NAC has been stressing for a new law and a stronger bill to eradicate the inhuman practice, which persists in India despite being banned. We need a stronger law, as it is not just a sanitation issue, but a question of fundamental rights and dignity." The Delhi Commission for Safai Karmcharis says the proposed bill which is supposed to include emancipation of manual scavengers should include in its ambit all forms of sanitary workers such as sewage cleaners and septic tank cleaners. "Since sewer workers have to enter manholes filled with fermented faeces and are also at risk, they should be covered by the bill. This practice is still prevalent under official patronage at all levels. The new bill should emancipate sanitary workers of all levels," Harnam Singh, chairman of the Delhi Commission for Safai Karmcharis, told IANS. Accusing the government of not being serious about the issue, D. Raja, national secretary, Communist Party of India (CPI) told IANS: "Despite several legislations and an Act, manual scavenging continues in the country and is a national shame. This indicates the callousness of the government. Around 19 years ago, the government has created an Act and now it is saying they will introduce a bill. This is just a question of passing time." He also said the CPI had suggested that the government call a meeting of chief ministers of those states where manual scavenging is prevalent to work on measures to eradicate it. "A law, a new bill or giving money to the state governments will not eradicate the disgraceful practice. The central government must make sure that state governments have some accountability in eradicating the practise. They should rope in good NGOs and penetrate to the grass-root level," Bindeswar Pathak, founder, Sulabh International told IANS.

Thursday, September 22, 2011

Java interview questions and answers

Adding an element to a simple linked listImage via Wikipedia1.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
What kind of thread is the Garbage collector thread? - It is a daemon thread.

2.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(….)
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.
5.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, …)
6.What is the basic difference between string and stringbuffer object? - String is an immutable object. StringBuffer is a mutable object.
7.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.
8.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.
9.What is the base class for Error and Exception? - Throwable
10.What is the byte range? -128 to 127
11.What is the implementation of destroy method in java.. is it native or java code? - This method is not implemented.
12.What is a package? - To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability.
13.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.
14.What is a DatabaseMetaData? - Comprehensive information about the database as a whole.
15.What is Locale? - A Locale object represents a specific geographical, political, or cultural region
16.How will you load a specific locale? - Using ResourceBundle.getBundle(…);
17.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.
Is JVM a compiler or an interpreter? - Interpreter
18.When you think about optimization, what is the best way to findout the time/memory consuming process? - Using profiler
19.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.
20.How will you get the platform dependent values like line separator, path separator, etc., ? - Using Sytem.getProperty(…) (line.separator, path.separator, …)
21.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.
22.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.
23.What is the significance of ListIterator? - You can iterate back and forth.
24.What is the major difference between LinkedList and ArrayList? - LinkedList are meant for sequential accessing. ArrayList are meant for random accessing.
25.What is nested class? - If all the methods of a inner class is static then it is a nested class.
26.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.
27.What is composition? - Holding the reference of the other class within some other class is known as composition.
28.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.
29.What are the methods in Object? - clone, equals, wait, finalize, getClass, hashCode, notify, notifyAll, toString
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.
30.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 … }
31.What is DriverManager? - The basic service to manage set of JDBC drivers.
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() ).
Enhanced by Zemanta

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Justin Bieber, Gold Price in India