- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Karthikeya Boyini has Published 2383 Articles
karthikeya Boyini
1K+ Views
The Assignment OperatorsFollowing are the assignment operators supported by Java language −OperatorDescriptionExample=Simple assignment operator. Assigns values from right side operands to left side operand.C = A + B will assign value of A + B into C+=Add AND assignment operator. It adds right operand to the left operand and assigns ... Read More
karthikeya Boyini
1K+ Views
Chained exception helps to relate one exception to other. Often we need to throw a custom exception and want to keep the details of an original exception that in such scenarios we can use the chained exception mechanism. Consider the following example, where we are throwing a custom exception while ... Read More
karthikeya Boyini
5K+ Views
The java.io.File class provides useful methods on file. This example shows how to check a file existence by using the file.exists() method of File class.Exampleimport java.io.File; public class Main { public static void main(String[] args) { File file = new File("C:/java.txt"); System.out.println(file.exists()); ... Read More
karthikeya Boyini
7K+ Views
Checked exceptionsA checked exception is an exception that occurs at the compile time, these are also called as compile time exceptions. These exceptions cannot simply be ignored at the time of compilation, the programmer should take care of (handle) these exceptions.For example, if you use FileReader class in your program ... Read More
karthikeya Boyini
782 Views
Java provides an assignment operator to copy the values but no operator to copy the object. Object class has a clone method which can be used to copy the values of an object without any side-effect. Assignment operator has a side-effect that when a reference is assigned to another reference ... Read More
karthikeya Boyini
604 Views
In Java, a final variable can a be assigned only once. It can be assigned during declaration or at a later stage. A final variable if not assigned any value is treated as a blank final variable. Following are the rules governing initialization of a blank final variable.A blank instance level ... Read More
karthikeya Boyini
3K+ Views
java.util.concurrent.The callable object can return the computed result done by a thread in contrast to a runnable interface which can only run the thread. The Callable object returns a Future object which provides methods to monitor the progress of a task being executed by a thread. The future object can ... Read More
karthikeya Boyini
529 Views
When a method is invoked on a null reference, it throws NullPointerException but in case of the static method, we can make it possible using cast expression. See the example below −ExampleLive Demopublic class Tester { public static void display(){ System.out.println("display"); } private void ... Read More
karthikeya Boyini
1K+ Views
'+' operator in java can be used to add numbers and concatenate strings. Following rules should be considered.Only numbers as operands then result will be a number.Only strings as operands then result will be a concatenated string.If both numbers and strings as operands, then numbers coming before string will be ... Read More
karthikeya Boyini
723 Views
Here is the syntax for declaring an array variable −SyntaxdataType[] arrayRefVar; // preferred way. or dataType arrayRefVar[]; // works but not preferred way.Note − The style dataType[] arrayRefVar is preferred. The style dataType arrayRefVar[] comes from the C/C++ language and was adopted in Java to accommodate C/C++ programmers.ExampleThe following ... Read More