resourceone.info Fiction Icse Java Complete Reference Pdf

ICSE JAVA COMPLETE REFERENCE PDF

Saturday, May 11, 2019


Java™: The Complete Reference,. Seventh Edition. Herbert Schildt. New York Chicago San Francisco. Lisbon London Madrid Mexico City. Milan New Delhi San. This book is to help ICSE students learn fundamental concepts of computing using object oriented approach in one computer language. It covers all syllabus of ICSE Computer Applications subject of standard IX and X. ICSE Java Complete Reference is a special edition that contains all. , USA. The web site for this book is: resourceone.info address contains links for downloading a copy of the web site and for downloading a PDF version of the certainly not a Java reference book, and it is not even close to a comprehensive survey of all The latest complete edition of Introduction.


Icse Java Complete Reference Pdf

Author:FREDRIC LIBBEE
Language:English, Spanish, French
Country:Kuwait
Genre:Fiction & Literature
Pages:792
Published (Last):03.01.2016
ISBN:790-7-54553-300-1
ePub File Size:18.61 MB
PDF File Size:10.26 MB
Distribution:Free* [*Regsitration Required]
Downloads:37495
Uploaded by: LEON

We are privileged to present the new edition of ICSE Computer Applications textbook for class IX. . and charts. Difference between absolute and relative references. Students should complete a number of laboratory assignments during the whole year to reinforce Introduction to Java – Data Values and Types. – 5 Designing and testing programs in Java. . ages this move, and the whole Object Oriented Programming movement that Java forms part of .. For reference material it may prove most convenient to use on-line documenta- tion, and in. The book of Herbert Schildt Java The complete reference is the wonderful book of book should you refers? then download the pdf version and go through it.

Thus maintenance becomes a problem. If the new programmer adds a new function to the existing code in the way of upgrading it, there is no guarantee that it will not affect the existing functions in the code.

This is because of global variables. In this way, data insecurity is created. To overcome this problem, programmers developed the concept of encapsulation. For example, let us have a struc. It is sure that all the twenty functions will not use all the global variables. Three of the global variables may be used only by two functions. But in a structured prog.

Every function will have access to all the global variables. A number with no sign is interpreted to be positive. What do you mean by Escape sequence and name few escape sequences in Java? Ans: Java have certain nongraphic characters nongraphic characters are those characters that can not be typed directly from keyboard e.

Those nongraphic character can be represented by escape sequence. An escape sequence is represented by backslash followed by one or more character.

How many integer constants are allowed in Java? How are they written? An Octal integer must be started with a zero '0', a Hexadecimal integer starts with a '0X', all others are treated as decimal integer constant.

What is meant by a floating constant in Java? How many ways can a floating constant be represented into? Ans: Floating constants are real numbers. A floating constant can either be a fractional or in exponent form.

Differentiate between Integer and Floating type constants. Ans: Integer constants are the whole numbers without decimal points. Floating point constants are fractional numbers number with decimal points. Write the following real constants into fractional form: 0. What is a type or 'Data Type'? How this term is related to programming? Ans: A type or datatype represents a set of possible values. When we specify that a variable has certain type, we are saying what values the expression can have.

For example to say that a variable is of type int says that integer values in a certain range can be stored in that variable. What is primitive data type? Name its different types. Ans: Primitive data types are those that are not composed of other data types. Numeric Integral, Fractional, character and boolean are different primitive data types.

State the two kind on data types? The primitive data types are: byte, short, int, long, float, double, char and Boolean.

Ans: The primitive data types are: byte, short, int, long, float, double, char and Boolean. How many bytes occupied by the following data types: byte, short, int, long, float, double, char, boolean. Ans: char-2 byte, byte-1 byte, short-2 bytes, int-4 bytes, long-8 bytes, float-4 bytes, double-8 bytes, boolean-Java reserve 8 bits but only use 1 bit.

What is the range of the following data types: byte, short, int, long, float, double, char, boolean. What is the largest and smallest value for floating point primitive data types float? Ans: The smallest value is What is Token? What are the tokens available in Java? What do you mean by variables? What do you mean by dynamic initialization of a variable? Ans: A variable is a named memory location, which holds a data value of a particular data types. When a method or functions is called and the return value is initialise to a variable is called dynamic initialisation.

What is the function of an operator? What do you mean by operator and write the name of all operators given in your textbook.

Ans: The operations are represented by operators and the object of the operations are referred to as operands. The types of Operators available in Java are: 1. Arithmetic 2. Relational 4. Logical 5. Shift 6. Bitwise 7.

Assignment 8. Conditional 9. What are arithmetic operators? Ans: Arithmetical operators are used for various mathematical calculations. The result of an arithmetical expression is a numerical values.

Arithmetical operators are of following types: Unary and Binary operators. Write major difference between the unary and binary operators? Ans: The operators that acts on one operand are referred to as Unary Operator. The operators that acts upon two operands are referred to as Binary Operator. What is increment operator? What are postfix and prefix increment operators? The increment operators add 1 to its operand. These are two types i Prefix and ii Postfix The prefix version comes before the operand for e.

Explain your answer. What do you mean by Relational Operators. Ans: Relational operators are used to determine the relationship between different operands. These are used in work of compression also. The relational expression condition returns 0 if the relation is false and return 1 if the relation is true.

What is Logical operators? Ans: The logical operators combine the result of or more then two expressions.

The mode of connecting relationship in these expressions refers as logical and the expressions are called logical expression. The logical expression returns 1 if the result is true otherwise 0 returns. Logical NOT. What do you man by Assignment Statement or Assignment Operator? It takes the value on the right and stores it in the variable on the left side.

What do you mean by Shift operators? Ans: A Shift operators performs bit manipulation on data by shifting the bits of its first operand right to left.

What do you mean by Bitwise operators? Ans: The Bitwise operations are performed by Bitwise operator. The Bitwise operations calculate each bit of their result by comparing the corresponding bits of the two operands.

Illustrate '? This operator is also known as ternary operator. The syntax for this operator is expression1?

What is the purpose of new operator? What do you mean by precedence? Illustrate with the help of example. Ans: Precedence is the order in which a program evaluates the operations in a formula or expression. All operators have precedence value. An operator with higher precedence value is evaluated first then the operator having lower precedence value.

Multiplication has been performed first in this expression. What is operands? What do you mean by constant? How you declare a variable as constant variables. The keyword final makes a variable as constants.

Which class is used for using different mathematical function in Java program? Math Q. What is the difference between these two function Math. Ans: Math. Where as the Math. What do you mean by type conversion? What is the difference between implicit and explicit type conversion explain with example.

Ans: The process of converting one predefined type into another is called Type Conversion. A implicit type conversion is a conversion performed by the compiler. The Java compiler converts all operands up to the type of the largest operand. This is also known as type promotion. Where as an explicit type conversion is user defined that forces an expression to be of specific type, this also known as type casting. What is coercion? How it is implemented?

Ans: Implicit type conversion of an expression is termed as coercion. This is default type conversion. What do you mean by type casting? What is the type cast operator? The operator that converts its operand to a specified type is called the typecast operator. The typecast operator is in Java and is used as type-to-be-converted-in Q.

Explain the methods print and println? Ans: A computer program is written to manipulate a given set of data and to display or print the results. Java supports two output methods that can be used to send the results to the screen. The print method sends information into a buffer. This buffer is not flushed until a new line or end-of-line character is sent.

As a result print method prints output on one line. The println method by contrast takes the information provided and displays it on a line followed by a line feed. What is an Expression? Explain its different types. It may be combination of operators, variables and constants.

There are three different types of expressions. Mention two different styles of expressing a comment in a program. Differentiate between operator and expression. The expression is any valid combination of operators, constant and variables. What is a compound Statement? Give an Example. Overloading constructor. What is constructor? Ans: A constructor is a Member function that automatically called, when the object is created of that class.

It has the same name as that of the class name and its primary job is to initialise the object to a legal value for the class. Why do we need a constructor as a class member? Why does a constructor should be define as public? Ans: A constructor should be define in public section of a class, so that its objects can be created in any function. Explain default constructor?

If we do not explicitly define a constructor for a class. The default constructor is often sufficient for simple class but not for sophisticated classes. Explain the Parameterised constructor? Constructor that can take arguments are called Parameterised constructor.

Define a class, which accept roll number and marks of a student. Write constructor for the class, which accepts parameter to initialise the data member. Also take care of the case where the student has not appeared for the test where just the roll number is passed as argument.

Mention some characteristics of constructors. Ans: The special characteristics of constructors are: i Constructors should be declared in the public section of the class. State the difference between Constructor and Method. The function must be called in programs where as constructor automatically called when the object of that class is created. Enter any two variables through constructor parameters and write a program to swap and print the values.

What are the types of Constructors used in a class? Ans: The different types of constructors are as follows: i. Default Constructors. Parameterized Constructor. Copy Constructors. Define Copy constructors. Ans: A copy constructors initializes the instant variables of an object by copying the initial value of the instant variables from another objects.

Pure functions return values and do not change state, impure functions may return values but also change state, return type argument to function, function prototype and function signature, overloading. Variable of a class type as reference to an objects, invocation of function on objects through the reference, the concept of this. Argument passing in functions, pass by value, what happened when a reference is passed side effect.

What is Function? Why do we use functions while programs handling? Ans: A named unit of a group of programs statements. This unit can be invoked from other parts of the program. Define Function prototype? Ans: The function prototype is the first line of the function definition that tells the program about the type of the value returned by the function and the number and types of arguments.

What is the use of void before function name? Thus a function that does not return a value is declared as follows. Ans: A function must be defined before it is used anywhere in the program. It may be any valid Java data type. Why main function so special? Ans: The main function is invoked in the system by default. Explain the function prototype and the signature? Ans: The function prototype is the first line of the function definitions, that tells the program about the type of the value returned by the function and the number and type of the arguments.

Function signature basically refers to the number and types of the arguments, it is the part of the prototype. Explain the function of a return statement?

First an immediately exit from the function is caused as soon as a return statement is encountered and the control back to the main caller. What is the default dangling-else matching and how it be overridden? The nested if-else statement introduces a source of potential ambiguity referred to as dangling-else problem. This problem arises when in a nested if statement, number of if's is more then the number of else clause.

The question then arises, with which if does the additional else clause property match. However Java matches an else with the preceding unmatched if. One method for over-riding the default dangling-else matching is to place the last occurring unmatched if in a compound statement, as it is shown below.

Compare and contrast IF with?: What is a switch statement? How is a switch statement executed? Switch statement successively tests the value of an expression against a set of integers or character constants.

When a match is found, the statements associated with the constants are executed. When a match is found, the statements sequence associated with that case is executed until the break statement or the end of switch statement is reached. What is the significance of break statement in a switch statement? In switch statement when a match is found the statement sequence of that case is executed until a 'break' statement is found or the end of switch is reached, when a 'break' statement is found program execution jumps to the line of code following the switch statement.

What is a control variable in a switch case? A control variable in switch case is one which guides the control to jump on a specified case. What is a "fall through"? The term "fall through" refers to the way the switch statement executes its various case sections. Every statement that follows the selected case section will be executed unless a break statement is encountered. What is the effect of absence of break in a switch statement?

Absence of break statement in a switch statement leads to situation called "fall through" where once a matching case is found the subsequence case blocks are executed unconditionally Q. Write one limitation and one advantage of switch statement? More efficient in case a value is to be tested against a set of constants.

Discuss when does an if statement prove more advantageous then switch statement. In the following case if statement proves to be more advantage over switch statement: When does switch statement prove more advantageous over an if statement?

The switch statement is more advantageous then the if statement when the test expression whose data type is either of byte, short, character, integer or long is to be tested against a set of constants. The reason being that the switch statement evaluates the expression once whereas the equivalent if statement evaluates the expression repeatedly. Explain, with the help of an example, the purpose of default in a switch statement. The default section is an optional part of the switch statement and the statement written under default clause are executed when no matching case is found.

Differentiate between if and switch statements. Both are used as a selection statements, there are some difference in their operations. Fixed number of Iteration. The for Loop, unknown number of Iteration - while, do-while loop, continue, break. Nested Loops. What are iteration statements? Name the iteration statements provided by Java?

Iteration statements are statements that allows a set of instructions to be executed repeatedly till some condition is satisfied. The iteration statements provided by Java are: What is the difference between entry controlled and exit controlled loop? What is the difference between while and do-while loop? The differences between these two loops are: Explain the difference between break and continue with an example. Both statements are used as a jumped statement. But there is a difference between Break and Continue statement.

The break statement terminate the loop, but the continue statement skip the rest of the loop statement and continued the next iteration of the loop.

Compare and discuss the suitability of three loops in different situation? Explain the term for loop with an example. In Java the 'for' statement is the most common iterative statement. Three statement separated by semi colons are placed with in the parenthesis. State one similarity and one difference between while and do-while loop.

In both loops there is a chances to forget the increment statement inside the loop. In while loop the test expression is evaluated at the beginning where as in do-while loop test expression is evaluated at the bottom, after the body of the loop. What do you meant by an infinite loop? Give an example. What do you meant by an endless loop? Infinite loop is an endless loop whose number of iterations are not fixed. Differentiate fixed and variable iterative type of loops. Fixed type of iterative loop is created when the process is to be repeated for defined number oft imes.

Differentiate Null loop and Infinite loop. A Null loop does not contains any statement to repeat where as infinite loop repeats execution of the statements for endless iterations. What do you mean by delay loop? A null loop is also called delay loop which does not repeat the execution of any statement but keeps the control engaged until the iterations are completed.

String, static variables and static methods, packages and import statements. What is the difference between byte oriented IO and character oriented IO?

How are these two performed in Java? What are the two ways of obtaining input in Java? Bye oriented IO reads bytes of data or binary where there is no notation of datatypes.

Character oriented IO on the other hand performs IO which is specially character oriented. What is an Exception? Exception in general refers to some contradictory or unusual situation which can be encountered while executing a program. What is exception and what is exception handling? During program development there may be some cases where the programmer does not have the certainty that this code-fragment is going to work right, either because it accesses resources that do not exist or it goes out of range.

These types of anomalous situations are generally called exception and the way to handle then is called exception handling. What are the advantages of Exception Handling? When is Exception Handling required? The exception handling is ideal for: What do you mean by try block? How do you define it, give an example. The try block is the one that contains the code that is to be monitored for the occurrence of an exception.

A try block is defined by enclosing the statements that might possible raise an exception in. For example if the formatting exception are to be handled while an integer is being read from the keyboard, then the following try block can be used: What do you mean by catch block? The catch block is the one that contains the code handle an exception.

It must follow the try block. If the catch block is written for the above try block then we may do it as follows: What is finally block? When and how it is used. The finally block is one of the exception handling blocks.

The code written in this block is always executed irrespective of whether an exception was reported or not, or even if it was handled successfully or not. The purpose of this block is to do cleaning up tasks, e.

Write down the function of the following IO Exception classes: Signals that an and of the file or end of the stream has been reached unexpectedly during input. Informs that a file could not be found. Warns that an IO operation has been interrupted. Signals the an IO exception of some sort has occurs. What are wrapper classes? Wrapper classes are the part or Java's standard library java.

Java provides the following wrapper classes: Boolean Integer, Float, Double, Character etc. Why do we need a wrapper class? A wrapper class is needed to store primitive values in objects as well as in conversion from string to to primitive type. Distinguish between data type and wrapper class. A data type starts with lowercase letter and wrapper class starts with uppercase letter.

Define String? A string is a set of two or more then two characters, a set of characters with the digit or a statement written with in double quotes. What is String Buffer? How we create a String Buffer? String Buffer is a type of memory location, which allows reasonable space to contain a string such a way that any change brought affect the same string.

String Buffer is created as follows: Differentiate between String and StringBuffer objects. The String object of Java is immutable, i. StringBuffer objects are mutable, on the other hand. That is these objects can be manipulated and modified as desired. Write down the purpose of the following string functions: The purpose and syntax of the following string functions are: This function converts all the characters of the string in lower case.

This function converts all the characters of the string in upper case. This function replace all the occurrence of a characters with another one. This function is used to remove all the white spaces at the beginning and end of string. This function is used to compare two string and give true or false if they are equal. This function return the length characters present in the string.

This function return the nth character of the string. This function returns the substring starting from the nth character of the string.

This function returns the position of the first occurrence a character in the string. This function returns negative if first string is less then second string, positive if greater and zero if equals.

What is the difference between equals and equalsIgnoreCase string functions? Both the functions is used to compare strings, the difference being that equals distinguishes between upper case and lower case version of a character, where as equalsIgnoreCase carries out comparison ignoring the case of characters.

Differentiate between equals and compareTo methods. Both the functions is used to comparing two strings, the difference being that i equals method only comparing two string and gives they are equal or not, where as compareTo methods also gives whether first string is greater or smaller then second one. Differentiate between toLowerCase and toUpperCase methods. The given two string method's change the case of the current string.

The toLowerCase method change the current string object to its equivalent Lower Case, where as toUpperCase method change the current string object to its equivalent Upper Case. What is the difference between the length and capacity string function. The function length returns the number of character contains in a string.

Where as capacity returns the maximum number of character that can be stored in a string objects. Name some of the most used packages? Language extensions java. Define static members? The members that are declared static are called static members.

These members are associate with the class it self rather than individual objects. What are static variables? Static variables are used when we want to have a variable common to all instances of a class. What are the restrictions of static methods? What are packages? Java contains extensive library of pre-written classes we can use in our programs. These classes are divided into groups called packages.

Various packages in Java are: What are the benefits of organizing classes into packages. In packages classes can be unique compared to other programs and be easily be reused. What are Java API packages: Java API packages provide a large number of class grouped into different packages according to functionality. What are system packages?

The packages which are organised in hierarchical structure are referred as system packages. Explain the method on importing a package member? To import a member of package into the current file, put an import statement at the beginning of the file before any class definitions but after the package statement, if there is one. Describe the method to import entire package? Distinguish between Static variable class variable and member variable instance variable i Declare with the static keyword.

Explain instance variable. A data member that is created for every objects of the class. It is a relational operator. It is a string function.

Computer Sciences Books

It compares two strings and gives the value as true or false. Explain the term 'Encapsulation' with an example? The wrapping up to data and methods into a single units called class is known as encapsulation.

For example an engine of car or any vehicle contains many small parts, which enables the entire machinery system to work.

Encapsulation property hides the inner working of objects from the real world. What does a class encapsulate? A class encapsulate Data Members that contains the information necessary to represent the class and Member Functions that perform operations on the data member. How does a class enforce information hiding? Classes enforce information hiding by means of access specifier.

What is initial class? A java program contains many classes. But one class in a Java program contains the main method. This class is called initial class. What is Class variable Static Variable? A data member that is declared once for a class. All objects of that class type, share these data members, as there is single copy of them available in memory.

Keyword 'Static' in the variable declaration makes a class variable. What is Instance variable? What does the class consists of? A class consists of: It contain information necessary to represent that class. It perform operations on the data members of the class.

What is visibility modifiers? It is also called access specifier. It defines which function or method is able to use this method.

Define variable's scope scope rule?

The program parts in which a particular data value e. Define the term visibility? Visibility is a related term which refers to whether one can use a variable from a given place in the program. Define the term Local variable and Global variable. Local Variable: Variable declared inside a method or block. Global Variable: Class variable which is available to the entire class.

Mention the levels of scope and visibility offered by java? Explain the different types of access specifier? It means that any one can call this method.

Theory Questions on BlueJ/Java

It means that only the methods in the same class are permitted to use this method. It means that methods in this class and methods in any subclass may access this method. What are member variables? State their types? Member variables are also known as Instance variables.

These member variables are used to store value in the class. It may be public, private and protected, where private and protected members remains hidden from outside world and there by support data. What is meant by private visibility of a method? The class objects compatible with all the class. What do you understand by Arrays? How you declare an Array? An Array is a collection of variables of the same data type that are referenced by a common name.

Array can be declared by the following statements: What are the different types of arrays? A list of items can be given one variable name using only one subscript and such a variable is called a single subscripted variable or a one or single dimensional array. This type of arrays are actually arrays of arrays. Why we use Arrays? The Advantages or Arrays are: How can arrays be initialized? Array can be initialized at the time of declaration by providing the value list at the same time.

What do you understand by out-of-bound subscripts? The subscripts other than 0 to n-1 for an array having n elements are called out-of-bounds subscripts. What do you mean by Binary Search?

This search technique searches the given ITEM in minimum possible compression. The Binary search requires the array must be sorted in any order. The search ITEM is compared with middle element of the array. If the ITEM is more then the middle element later part of the arrays becomes the new array segment.

ICSE Java Complete Reference

The same process is repeated until either the ITEM is found or the array segment is reduce to single element. Differentiate between linear search and binary search techniques? In linear search each elements of the array is compared with the given item to be searched for one by one while binary search searches for the given item in a sorted array. The search segment reduces to half at every successive stage. State the conditions under which Binary Search is applicable? For Binary Search The List must be sorted, lower bound upper bound and the sort order of the list must be known.

Comment on the efficiency of linear search and Binary Search in relation to the number of element in the list being searched? The Linear search compares the search item with each element of the array, one by one. If the search item happens to be in the beginning of the array, the compressions are low, however if the element to be searched for is one of the last elements of the array, this search technique proves the worst as so many comparisons take place. The Binary search on the other hand, tries to locate the search item in minimum possible comparisons, provided the array is sorted.

This technique proves efficient in nearly all the cases. What do you mean by sorting? Sorting of an array means arranging the array elements in a specified order.

What is Selection sort? In selection sort the smallest or largest depending upon the desired order key from the remaining unsorted array is searched for and put in the sorted array. The process repeats until the entire array is sorted.

ICSE BlueJ Theory

What is Bubble sort? In bubble sort the adjoining values are compared and exchanged if they are not in proper order. This process is repeated until the entire array is sorted. Which element is num[9] of the array num? So 9th element is treated as the 10th element in an array. What is File? A file is a means of making data persistent.

It is a set of bytes that is stored on a storage device and can be referred to by a name.Ans: EOFException: Signals that an and of the file or end of the stream has been reached unexpectedly during input.

Ans: A constructor should be define in public section of a class, so that its objects can be created in any function. The availability of user-defined datatypes depends upon their scope. Its to the point. The constructor that accepts no parameter is called the default constructor. What is composite user define data type? The code written in this block is always executed irrespective of whether an exception was reported or not, or even if it was handled successfully or not.