Throws keyword and Constructors   Definitely, we can use throws keyword with constructors because constructors may have many numbers of statements which are proven to generate exception class objects.   Class Edemo4 { Int    I, j, k; Edemo4 (int x, int y) throws Exception { I=x; j=y; K – i/j; } } Class Test4 {…


Defining functions with a return type   Whenever we can define a function with a return data type, then we should not close the function without returning the value of the return data type. So a blind rule we follow is to declare a variable of the return data type as the first statement inside…


Arrays – In java arrays are treated as objects. While using arrays we create objects for arrays where a class is nonexistent. Whenever JVM encounters [] It understands that it has to create an object. Thus array object can be created without using the new operator. Whenever JVM encounters it understands that it has to create an…


Implementing the sleep () Example program: Class Sdemo1 extends Thread { Public void run () { Try { Thread .sleep (837); } Catch (Exception e) { System. Out. Prinln(e); } For (int i=0; i<37; i++) System. Out. Prinln(“ run of Sdemo1: “+i); System. Out. Prinln(“end of run()”); } Public static void main (string args […


Platform Independency Platform Independency is more specifically concerned with the compiled code of a java program should be executed in any operating system, irrespective of the operating system in which that code had been implemented. Reasons That Control Platform Independence Java’s architecture facilitates the creation of platform-independent software, but also allows you to create software…