Showing posts with label CS 2305 PROGRAMMING PARADIGM. Show all posts
Showing posts with label CS 2305 PROGRAMMING PARADIGM. Show all posts

Saturday, August 16, 2014

CS 2305 PROGRAMMING PARADIGM - Unit 3

1.What is the byte range? & What is the implementation of destroy method in java.. 
is it native or java code? 
128 to 127 .This method is not implemented. 

2.What is a package? 
To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability. 
  
3.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. 

4. What is Locale? 
 A Locale object represents a specific geographical, political, or cultural region 

5. How will you load a specific locale? 
 Using ResourceBundle.getBundle(…); 

6. 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. 

Friday, August 15, 2014

CS 2305 PROGRAMMING PARADIGM - Unit 2

11. 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 

12. What kind of thread is the Garbage collector thread? - It is a daemon thread. 

13.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. 

14. How will you invoke any external process in Java?  
Runtime.getRuntime().exec(….) 

15. 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. 

Thursday, August 14, 2014

CS 2305 PROGRAMMING PARADIGM - Unit 2

1. What's the difference between a queue and a stack? 
 Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule 
 
2. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces? 
Sometimes. But your class may be a descendent of another class and in this case the interface is your only option. 
 
3. What comes to mind when you hear about a young generation in Java? 
Garbage collection. 
 
4. What comes to mind when someone mentions a shallow copy in Java? 
 Object cloning. 
 
5. If you're overriding the method equals() of an object, which other method you might also consider? 
hashCode()