Tag: Notes for BIM
Unit 14 : Input/output:
Java I/O A stream is continuous group of data or a channel through which data flows from one point to another point. Java implements streams within class hierarchies defined in the java.io package. Byte streams provide a convenient means for handling input and output of bytes. Byte streams are used, for example, […]
Continue ReadingUnit 13 : String handling
String A string is a set of one or more characters enclosed in double quotes or simply a string is an array of characters. Strings, which are widely used in Java programming, are a sequence of characters. In the Java programming language, strings are objects. The Java platform provides the String class to create […]
Continue ReadingUnit 11 : Multithreaded programming
A multithreaded program contains two or more parts that can run concurrently. Each part of such a program is called a thread, and each thread defines a separate path of execution. Thus, multithreading is a specialized form of multitasking. There are two distinct types of multitasking: process-based and thread-based. A process-based multitasking is the feature […]
Continue ReadingUnit 10 : Exception handling java programming
Exception Handling Error occurred in a program can be of two types: syntax error or logical error. An exception is an abnormal condition that arises in a code sequence at run time. In other words, an exception is a run-time error. A Java exception is an object that describes an exceptional (that is, […]
Continue ReadingUnit 9 : Packages and Interface
Package and Interface Packages are containers for classes that are used to keep the class name space compartmentalized. For example, a package allows us to create a class named List, which you can store in your own package without concern that it will collide with some other class named List stored elsewhere. Packages are stored in a […]
Continue ReadingUnit 8 : Inheritance
Inheritance It is the process by which object of one class can acquire the properties of object of another class. The class, from which properties are inherited, is known as super class. The class, to which properties are inherited, is known as sub class. A sub class inherits all of the variables and methods defined by the […]
Continue ReadingUnit 6 & 7 java programming
Class and object A class is a user defined data type which binds data and function into a single unit and objects are the instance of a class. A class is declared by use of the class keyword. The general form of a class definition is shown here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
class classname { type instance-variable1; type instance-variable2; type instance-variablen; type methodname1(parameter-list) { // body of method } type methodname2(parameter-list) { // body of methodTHE JAVA LANGUAGE } type methodnamen(parameter-list) { // body of method } } |
The data, or variables, defined within a […]
Continue ReadingUnit 5 : Control Statements
Java’s Control Statements A programming language uses control statements to cause the flow of execution to advance and branch based on changes to the state of a program. Java’s program control statements can be put into the following categories: selection, iteration, and jump. Selection statements allows program to choose different paths of execution based upon the outcome of […]
Continue Reading