×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Tutorix
Login
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Q/A
Library
eBooks
Courses
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Raja
has Published
806
Answers
How to rethrow an exception in Java?
Java
Object Oriented Programming
Programming
raja
Published on 13-Jun-2019 15:00:52
Sometimes we may need to rethrow an exception in Java. If a catch block cannot handle the particular exception it has caught, we can rethrow the exception. The rethrow expression causes the originally thrown object to be rethrown.Because the exception has already been caught at the scope in which the ...
Read More
What is the importance of the Throwable class and its methods in Java?
Java
Object Oriented Programming
Programming
raja
Published on 13-Jun-2019 14:38:26
The Throwable class is a superclass of all errors and exceptions in Java. Objects that are instances of this class are thrown by the Java Virtual Machine or can be thrown by a throw statement. Similarly, this class or one of its subclasses can be the argument type in a catch clause.Instances of ...
Read More
When to use an abstract class and when to use an interface in Java?
Java
Object Oriented Programming
Programming
raja
Published on 13-Jun-2019 10:42:13
An interface can be used to define a contract behavior and it can also act as a contract between two systems to interact while an abstract class is mainly used to define default behavior for subclasses, it means that all child classes should have performed the same functionality.When to use ...
Read More
Can we create an object of an abstract class in Java?
Java
Object Oriented Programming
Programming
raja
Published on 12-Jun-2019 15:09:52
No, we can't create an object of an abstract class. But we can create a reference variable of an abstract class. The reference variable is used to refer to the objects of derived classes (subclasses of abstract class).An abstract class means hiding the implementation and showing the function definition to ...
Read More
What is a constant and how to define constants in Java?
Java
Object Oriented Programming
Programming
raja
Published on 12-Jun-2019 12:28:35
A constant is a variable whose value cannot change once it has been assigned. Java doesn't have built-in support for constants.A constant can make our program more easily read and understood by others. In addition, a constant is cached by the JVM as well as our application, so using a ...
Read More
Can we declare more than one class in a single Java program?
Java
Object Oriented Programming
Programming
raja
Published on 12-Jun-2019 08:00:54
A single Java program contains two or more classes, it is possible in two ways in Java.Two Ways of Implementing Multiple Classes in a single Java ProgramNested ClassesMultiple non-nested classesHow the compiler behave with Multiple non-nested classesIn the below example, the java program contains two classes, one class name is ...
Read More
How many ways to prevent method overriding in Java?
Java
Object Oriented Programming
Programming
raja
Published on 12-Jun-2019 07:38:43
Method overriding works because of the run-time method binding feature in Java. So, if we force the java compiler to do static binding for a method then we can prevent that method from being overridden in a derived class.We can prevent method overriding in Java in 3 waysBy making method ...
Read More
Why we should follow the naming conventions in Java?
Java
Object Oriented Programming
Programming
raja
Published on 10-Jun-2019 15:26:25
Naming conventions in Java make programs more understandable by making them easier to read.In Java, class names generally should be nouns, in title case with the first letter of each separate word capitalized. and interface names generally should be adjectives, in title case with the first letter of each separate ...
Read More
What are the differences between default constructor and parameterized constructor in Java?
Java
Object Oriented Programming
Programming
raja
Published on 10-Jun-2019 14:07:02
Default ConstructorA default constructor is a 0 argument constructor which contains a no-argument call to the super class constructor.To assign default values to the newly created objects is the main responsibility of default constructor.Compiler writes a default constructor in the code only if the program does not write any constructor in ...
Read More
What are the different types of classes in Java?
Java
Object Oriented Programming
Programming
raja
Published on 10-Jun-2019 13:17:02
Types of classes in JavaConcrete classAny normal class which does not have any abstract method or a class that has an implementation of all the methods of its parent class or interface and its own methods is a concrete class.ExampleLive Demopublic class Concrete { // Concrete Class static int ...
Read More
Previous
1
...
72
73
74
75
76
77
78
...
81
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout