- 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
Verification in Java (JVM)
Once the byte code is loaded by the JVM, (with the help of the .class file), the bytecode is checked to see the validity with the help of the verifier. The verifier checks the linking so as to perform operations efficiently. This way, the interpreter performs much efficiently. This process is known as verification.
Example
public class Demo{ private float my_val; float my_function(int my_val){ int balance = my_val; this.my_val += balance; return this.my_val; } public static void main(String[] args){ Demo my_obj = new Demo(); System.out.println("The instance of Demo has been created"); System.out.println(my_obj.my_function(3456)); } }
Output
The instance of Demo has been created 3456.0
A class named Demo contains a float value. Another function named ‘my_function’ adds a given value to the float value. In the main function, an instance of the Demo class is created, and the ‘my_function’ is called on this object. Relevant output is displayed on the console.
Advertisements