Popular posts from this blog
Difference Between Compiler and Interpreter and Difference between JDK, JRE and J VM
Difference Between Compiler And Interpreter A compiler takes entire program and converts it into object code which is typically stored in a file. The object code is also refereed as binary code and can be directly executed by the machine after linking. An Interpreter directly executes instructions written in a programming or scripting language without previously converting them to an object code or machine code. Difference Between Java Development Kit(JDK), Java Run Time Environment(JRE) And Java Virtual Machine(JVM) JVM ( Java Virtual Machine ) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent . The JVM performs following main tasks: Loads code Verifies code Executes code Provides runtime environment ...
Constant in Java
Constant in Java A constant in java is used to map and exact and unchanging value to a variable name. Final variables are often declared with static keyword in java and treated as constant . Final keyword in variable declaration: Syntax: final datatype v 1 = val 1 , v 2 =val 2, ----------------------V n = Val n ; Ex: public static final double PI = 3.14159; Final keyword in method level: A java method with final keyword is called final method and it cannot be overridden in sub-class . Syntax: final returntype methodname(list of formal parameters) { block of statements; } ...
Comments
Post a Comment