printstream class method println() is calling using System class and its static object out .how it is explain any one in detail with example ?
TCS,
1 5389suppose in a class there is a code like this: { Set hs=new Hashset(); hs.add(new Emp("kathy",1000)); hs.add(new Emp("kathy",2000)); } how can u avoid the above code in your class as set won't allow duplicate objects?
3 6623Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
2601For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green White will have 1 Weight. Red and Green carry no weights. Shortest path is the path with less weight when you add up the weights in the path.
2017we have two threads..both the threads are reading the data.. is there any need of synchronization there?...justify it?
IBM,
4 8353
In a class implementing an interface, can we change the value of any variable defined in the interface?
How do you decide when to use arraylist and linkedlist?
Give any two differences between C++ and java.
What do you mean by global variable?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
What are advantages and disadvantages of OOPs?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
Write java program to reverse string without using api?
Explain covariant method overriding in java.
What is the method in java?
Can an integer be a string?
What is an object in java?
What is the use of bufferedreader?
What is the importance of finally block in exception handling?
What is the use of static class?