Advertisement
Nickname
instanceof
Registered since:
January 12, 2015
Short bio:
 
Home page:
 
Total posts:
576

Forum posts by instanceof java:

39 pages [ Previous 1 ... 24 25 26 27 28 29 30 31 32 33 34 Next ]
Posted in All Buzz Forum, Aug 23, 2015, 11:20 AM
Limitations of Arrays:Arrays are fixed in size. need to estimate the size of an array while declaration itself. once array created we can not increase the size of an array.Arrays can hold only homogeneous data elements. Means we can add same type of elements in an array. While declaring an array we need to mention the data type.int a[]= new...
Posted in Java Buzz Forum, Aug 23, 2015, 11:20 AM
Limitations of Arrays:Arrays are fixed in size. need to estimate the size of an array while declaration itself. once array created we can not increase the size of an array.Arrays can hold only homogeneous data elements. Means we can add same type of elements in an array. While declaring an array we need to mention the data type.int a[]= new...
Posted in All Buzz Forum, Aug 15, 2015, 4:33 PM
Exception and Error both are sub classes of java.lang.Throwable class.We can handle Exceptions at runtime but Errors we can not handle.Exceptions are the objects representing the logical errors that occur at run time and makes JVM enters into the state of  "ambiguity".The objects which are automatically created by the JVM for representing...
Posted in Java Buzz Forum, Aug 15, 2015, 4:33 PM
Exception and Error both are sub classes of java.lang.Throwable class.We can handle Exceptions at runtime but Errors we can not handle.Exceptions are the objects representing the logical errors that occur at run time and makes JVM enters into the state of  "ambiguity".The objects which are automatically created by the JVM for representing...
Posted in All Buzz Forum, Aug 15, 2015, 2:33 PM
YES StringBuffer and StringBuilder classes not overriding equals()method and haschcode() method.Before discussing about why these classes are not overriding equas() and hashcde() methods lets see the usage of overriding equals and hashcode() methods.String class is overriding these equals() and hashcode() methods.When we want to compare two...
Posted in Java Buzz Forum, Aug 15, 2015, 2:33 PM
YES StringBuffer and StringBuilder classes not overriding equals()method and haschcode() method.Before discussing about why these classes are not overriding equas() and hashcde() methods lets see the usage of overriding equals and hashcode() methods.String class is overriding these equals() and hashcode() methods.When we want to compare two...
Posted in All Buzz Forum, Aug 8, 2015, 3:29 PM
1.Can we define a class without main method?No, you can’t run java class without main method. Before Java 7, you can run java class by using static initializers. But, from Java 7 it is not possible.2.Can main() method take an argument other than string array?No, argument of main() method must be string array. But, from the...
Posted in Java Buzz Forum, Aug 8, 2015, 3:29 PM
1.Can we define a class without main method?No, you can’t run java class without main method. Before Java 7, you can run java class by using static initializers. But, from Java 7 it is not possible.2.Can main() method take an argument other than string array?No, argument of main() method must be string array. But, from the...
Posted in All Buzz Forum, Jul 25, 2015, 8:23 PM
Its recommended to learn about life cycle of Thread before you start programming on Thread.Threads exists in different type of states.Thread having below states.New StateReady StateRunning StateDead StateNon Runnable States 1.New State:A thread has been created but not started yet. A thread will be started by calling its start()...
Posted in Java Buzz Forum, Jul 25, 2015, 8:23 PM
Its recommended to learn about life cycle of Thread before you start programming on Thread.Threads exists in different type of states.Thread having below states.New StateReady StateRunning StateDead StateNon Runnable States 1.New State:A thread has been created but not started yet. A thread will be started by calling its start()...
Posted in All Buzz Forum, Jul 25, 2015, 6:23 PM
throw keyword:throw keyword used to throw user defined exceptions.(we can throw predefined exception too)If we are having our own validations in our code we can use this throw keyword.For Ex: BookNotFoundException, InvalidAgeException (user defined).Program:package com.instanceofjava;public class MyExceptionThrow { public static void...
Posted in Java Buzz Forum, Jul 25, 2015, 6:23 PM
throw keyword:throw keyword used to throw user defined exceptions.(we can throw predefined exception too)If we are having our own validations in our code we can use this throw keyword.For Ex: BookNotFoundException, InvalidAgeException (user defined).Program:package com.instanceofjava;public class MyExceptionThrow { public static void...
Posted in All Buzz Forum, Jul 25, 2015, 4:23 PM
Apart from java we have Existing Exceptions. and we can also create our own Exceptions nothing but User defined Exceptions.User defined exceptions in java are also known as Custom exceptions.Program:InvalidAgeException .java:package com.instanceofjava;class InvalidAgeException extends Exception{    InvalidAgeException(String s){ ...
Posted in Java Buzz Forum, Jul 25, 2015, 4:23 PM
Apart from java we have Existing Exceptions. and we can also create our own Exceptions nothing but User defined Exceptions.User defined exceptions in java are also known as Custom exceptions.Program:InvalidAgeException .java:package com.instanceofjava;class InvalidAgeException extends Exception{    InvalidAgeException(String s){ ...
Posted in All Buzz Forum, Jul 25, 2015, 2:24 PM
try block:The functionality of try keyword is to identify an exception object.And catch that exception object and transfer the control along with the identified exception object to the catch block by suspending the execution of the try block.All the statements which are proven to generate exceptions should be place in try block.Syntax of try...
39 pages [ Previous 1 ... 24 25 26 27 28 29 30 31 32 33 34 Next ]
Advertisement