Chapter 5 Type conversion in Java The process through which we convert value of one data type into another data type is called as Type Conversion. ⦁ If we want to store a value of lower size data type value into higher size data type variable e.g. float a=3; it is permissible in java language. this type of the conversion is called widening conversion. ⦁ We cannot directly assign a higher size data type variable e.g. int a=3.5; //error syntax to assign higher size data type value into lower size data type variable HigherSizeDatatype variable=(lowersizedat type) value ; e.g. int a=(int)3.5; ⦁ It will assign integer part of 3.5 which is 3 to a.
Posts
Showing posts from February, 2020
- Get link
- X
- Other Apps

Chapter 4 Keywords and Data type in Java There are 32 keywords in Java language 1. abstract 2. assert 3. boolean 4. break 5. byte 6. case 7. catch 8. char 9. class 10. const 11. continue 12. default 13. do 14. double 15. enum 16. else 17. extends 18. false 19. final 20. finally 21. float 22. for 23. goto 24. if 25. implements 26. import 27. instanceof 28. int 29. interface 30. long 31. native 32. new 33. null 34. package 35. private 36. protected 37. public 38. return 39. short 40. static 41. strictfp 42. super 43. switch 44. synchronized 45. this 46. throw 47. throws 48. transient 49. true 50. try 51. void 52. volatile 53. while ⦁ False, null and true will be treat as a value. ⦁ Java language supports Unicode. ⦁ syntax for deceleration of a variable. DataTypeName VariableName; e.g. : int var; ⦁ If the constant is to repres...
- Get link
- X
- Other Apps
Chapter 3 First Program in Java ⦁ Syntax for deceleration of class access specifier class ClassName { /* Body of class is followed by curly bracket*/ } ⦁ An outer class can be followed by either public access specifier or default access specifier. ⦁ Name of class and name of source code must be same. ⦁ The main() function must follow the following prototype : public static void main (String [] args) { // Body of main() function } ⦁ Code of HelloWorld.java class HelloWorld { public static void main (String [] args) { System.out.println("Hello World"); } } Comments :- a. Here System is a predefined class. b. out is a static member reference variable of System class which contains address of an variable of PrintStream class. c. println() is a member function of PrintStream class. Output :- Hello World ⦁ We have to write an access specifier with every member in a class.
- Get link
- X
- Other Apps

Chapter 2 Compilation and Execution of a Java Program ⦁ Java Language uses only one compiler javac.exe for all platforms. ⦁ After compilation of a java program every class in source code will convert into individual Byte code. ⦁ A Byte code can be execute on any operating system with help of Java Virtual Machine (JVM). ⦁ JVM consists an Interpreter (which is Just-in-time compiler) can can convert Byte code into operating system readable form. ⦁ JVM differs fro compiler to compiler. ⦁ Java Developer Kit (Jdk) contains tools needed to develop the java program like compiler (javac.exe), Application Launcher (java.exe), etc. ⦁ Java Runtime Environment (Jre) contains JVM and Java package Classes (Java library). ⦁ Code for compilation a java program on command prompt : javac FileName.java ⦁ Code for execution of java program on command prompt : java FileName
- Get link
- X
- Other Apps
Chapter 1 Introduction to Java Java language was developed by James Gosling at Sun Micro system, Inc. in 1991. Today it is product of Oracle. We can develop software in Java language for ⦁ Mobiles ⦁ Client Machines ⦁ Server Machines ⦁ Cloud ⦁ Embedded Devices ⦁ Smart Phones ⦁ and many more............. The Three main flavors of Java 1. Java Standard Edition / Core Java 2. Java Embedded Edition / Advanced Java 3. Java Micro Edition (for mobiles) Features of Java ⦁ It is Simple & Object Oriented language. ⦁ Distributed : Program of Java can be execute on several platforms. ⦁ Portable : Program made for a specific OS can be move to another OS. ⦁ It is an Interpreted language. ⦁ It is robust and secure. ⦁ It contains faci...