Trending ▼   ResFinder  

notes of computer application

3 pages, 6 questions, 0 questions with responses, 0 total responses,    0    0
Namratha Simha
Shantiniketan Trust School, Bangalore
+Fave Message
 Home > namratha_simha123 >

Formatting page ...

Notes for 10th notes : Java compilation : The java compilation takes place in 2 steps. First, the source code is compiled by the java compiler into byte code. The byte code is an intermediate code, which looks similar to the machine code, and it is the same on every platform, which helps in making java platformindependent. In the second step, this byte code is interpreted by the Java Virtual Machine (JVM), which is different for different platforms. Thus, the byte code together with JVM makes java platform independent. compiled interpreted Source code java byte code Machine language (a.java) (compiler) (a.class) (JVM) Call by Value and Call by Reference : In call by value, the calling function passes the values of variables to the called method, which makes copies of the actual parameters. It works on the formal parameters, so any change of the formal parameter values does not affect the actual parameters. The primitive data types are passed by value. In call by Reference, the calling function passes the reference of the values (i.e. object) to the called method. So the formal parameters also refer to the original variables. Thus any changes made in the called method is reflected back in the original values. Input/Output Streams : (the following is a general note, use whichever part is necessary according to the question.) A source of input data (data accepted into the computer) is called and input stream and a source of output data (data displayed on the output device) is called output stream. Inputting data is called reading data and outputting data is called writing data. System is a class of the java.lang package. System.in is an object of the abstract class Inputstream and System.out is an object of the abstract class PrintStream. Both these abstract classes are part of the java.io package. System.in object is automatically created and connected to the keyboard by the System class and is available for the user to use. So both the java.io and java.lang should be part of the program. Java.lang is automatically imported into a program, but java.io has to be imported by the programmer. The PrintStream class has several methods like print(), println(), write() to output data. Similarly the System.in.read() is a method of the InputStream class, used read a single character. The streams can be classified according their manner of input/output of data. They are: 1.ByteOriented : They input/output one byte (8 bits) of data at a time. 2.Character oriented : They input/output one character of data at a time. Since java uses Unicode character set, each character occupies 2 bytes. The input / output streams of ByteOriented are DataInput and DataOutput. The most commonly used character oriented IO streams used in java programs are :

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us

 

namratha_simha123 chat