Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
19 views
9 pages
Bluej
Blue j notes for class 9
Uploaded by
vaibhavbhadani044
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Bluej For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
19 views
9 pages
Bluej
Blue j notes for class 9
Uploaded by
vaibhavbhadani044
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Bluej For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Bluej For Later
You are on page 1
/ 9
Search
Fullscreen
NOTES OF BLUEJ STD: 1K ‘CARMEL SCHOOL,GIRIDIH Important features of OOPs : «Abstraction : is a concept of hiding unnecessary details and representing only the very essential features. «Encapsulation : wrapping up of data and methods in a single unit called class known as encapsulation. * Polymorphism : a function behaving differently upon different objects known as polymorphism . polymorphism Implements function overloading. + Inheritance : is the process by which an object acquires the properties of another object. Class : is the collection of objects of the same kind i. that share the common properties and relationship. ‘Objects : it is an instance of a class having some characteristic and behaviors. Characteristics of an object : identity , classification , inheritance and polymorphism. Data types : identify what type of value can be stored in a particular variable. ‘Types of data type : Primitive data types : are not composed of other data types . they are as follows : byte :1 byte eine short: 2 bytes 23 ty 284 int :4 bytes 231 to 231-1 long :8bytes — :-2%t0 2-1 float: 4 bytes double : 8 bytes char: 2 bytes (ithas a minimum value of \u0000 (or 0) and a maximum value of \uffff (or 65,535 inclusive) boolean : 1 byte In-addition to 8 primitive data types Java provide specia? support for character String through the Java.lang.String class. String objects once created , their value can not be changed. Default values for each data types : Data types Default values byte 0 short 0 int 0 long OL float 0.0F double 0.0 char "20000" 1[Page NIRMAL KUMAR JHA 8-Apr-20 Scanned with CamScannerNOTES OF BLUE STD: IK CARMEL SCHOOL,GIRIDIH boolean false String null Non primitive data types : are composed of other data types * Token : is the smallest unit of program. Various features of token are as follows : «Keywords : are the reserved words used within the program to specify a particular task. «Identifiers : represent variables , objects, class, method and arrays. «Literals : are the constants which remains constant within the program, Types of literals are as follows Integer literals : contain integer numbers , which can be either positive or negative. © Floating literals : contain real numbers , which can be either positive or negative. o Character literals : contain only one character and must be enclosed within single quote. ©. String literals : contain one or more than one characters and must be enclosed in double quotes. © Boolean literal : contains only true or false. «Separators : include special characters such as ,; 1 { } () ete. © Operators : are special symbols that perform specific operations , according to a precedence on one or more operand to return result. The Types of operators are as, follows : © Arithmetic operators : contain arithmetical symbols such as +,-,%, /, % o Assignment operators : are used to assign values to a variable /=,96= are the assignment operators. Unary operators : contain only one operand . they are ++, Binary operators : contain two operands . Ternary operators : contain three operands. They are ?, : Relational operators : these operators determine one operand is less than, greater than, equal or not . they are >,<,>=,<=,!=,= = © Logical operators : are used to join more than one condition. They are &&,|,! e000 Block : is a group of one or more statements between a pair of curly braces { }. Statements : are similar to sentences in human languages. A statement forms a complete unit of execution. Expression : is a construct made up of variables , operators and method invocations that evaluates to single value. Mixed mode expression : depend on the types of largest operand in the expression. Comment : is a remark from the programmer to explain some aspect of the code top someone who is reading the source code. Comment lines are ignored by the compiler. ‘Types of comment : Single line comment ( //): only one line of text can be written. Multi line comment : (/* .......*/) : multiple lines of comment can be written in this. Documentation comment (/**,...sesssses0e4/) : they are used to produce HTML file. Unicode : defines a complete international character set that can represent all the characters found in all human languages. Java character is 16 bit type. 2|Page NIRMAL KUMAR JHA 8-Apr-20 Scanned with CamScannerNOTES OF BLUEJ conversion compiler checks STD: Ik CARMEL SCHOOL, GIRIDIH ‘Type conversion : The process of converting one primitive type to another is called type conversion or casting. Following are the types of conversion : i. Implicit conversion or automatic conversion or widening or coercion : in this in that type only result is being given. ii, Expl the whole expression , whichever data type is higher, it conversion or type casting or Narrowing : conversion from one type to another type using type cast operator () in a a java program is done using programmer’s interventions. Java Operator Precedence Table( Higher to lower) ‘Operator ‘Type 0 |Parentheses Array subscript Member selection [Unary post-increment [Unary post-decrement nary logical negation [Unary type cast [Muttiptication Division Modulus |Addition [Subtraction Relational less than Relational less than or equal Relational greater than [Relational greater than or equal Relational is equal to [Relational is not equal to [Logical AND [Logical OR [Ternary conditional [Assignment |Addition assignment Subtraction assignment Multiptication assignment Division assignment Modulus assignment Variable : is the name of the memory location that stores some value. 3|Page NIRMAL KUMAR JHA Scanned with CamScanner 8-Apr-20NOTES OF BLUES STD: Ik CARMEL SCHOOL, GIRIDIH Java byte code : a compiler Javac , transform the java language source code to byte code that runs in JVM. Escape sequence characters : the characters interpreted with a backslash are called escape sequence or escape characters. They are as follows : \\ : backlash \b: backspace \r: carriage return \n: new line \" double quote \t stabbing ‘Types of loop : ~ Entry control loop : in these loop constructs the test expression is evaluated before each iteration. E.g. : for and while loop. + Exit control loop : in these loop construct the test expression is evaluated after each iteration. E.g. : do-while loop. Definite loop : a loop which performs up to given limit, Indefinite loop : itis a loop which performs as long as user wants. while loop : is the fundamental looping statement. It repeats a statement or block of statement while the expression that controls it, is true. for loop : itis a loop which has pre-determined number of iterations. It provides a step by step way of performing repeated actions. do-while loop : itis a loop that tests the condition at the end of the loop rather at the beginning. while vs do-while loop while do-while It checks for the condition first and then executes the block of statement It executes block of statements once and then checks for the condition. known in beforehand. for Vs while : 2. tis entry control loop. Tris exit control Joop. 3. Itdoes not execute if condition is not it executes at least once even if the condition true. is false. Similarity between while and do-while loop : in the both the loop number of iterations are not for while This loop is used when the number of iteration is known beforehand This loop is used when the number of iteration is not known beforehand. Similarity between for and while loop :Both are the entry control loop Significance of (,) operator in for loop : using (,) operator wecan include more than one statement in the initialization and updation part of for loop. Jumping statement : are used to transfer control to another part of the program. Following are the jumping statements : > break : is used to terminate a loop or a statement sequence in switch statement . 4|Page NIRMAL KUMAR JHA 8-Apr-20 Scanned with CamScannerNOTES OF BLUEJ STD: 1K ‘CARMEL SCHOOL,GIRIDIH > continue : transfer the control back to the loop for the next iteration, > return : transfers the control back to the calling module. break label : using break label, control is being transferred to the statement after the labeled statement continue label : using continue label , control is transferred to the beginning of the loop identified by the label. If statement : tells the compiler to take one of two alternative courses of action depending on whether the value of a given boolean valued expression is true or false. It is a branching or decision making statement. Scope of a variable : defines the section source code from where the variable can be accessed. Lifetime of a variable : determines how long the variable continues to exist before itis, destroyed. Compound statement : multiple statements placed within the curly braces form a compound statement. ‘Ternary operators Vs. if else statement : Ternary operators If else Tis used for single expression Tris used for single as well as compound statement and expression. Produces an expression and returns a value _| It is a statement. It can have multiple statements, multiple assignments and expression in its body. Tn nested form it is more complex Tn nested form itis not complex. Every conditional operators can be replaced | But every if else code can not be replaced with if else code with conditional operator as if else can have multiple statements, What happens in absence of break in switch case? In absence of break in switch case all statements after the matching case label are executed in sequence, regardless of the expression of subsequent case labels, until a break statement is encountered. The same situation is also known as fall through. Control flow statement : are statements that break up the flow of execution by employing decision making, looping and branching to enable a program to conditionally execute only particular blocks of code. Library functio Math class contains following function : 1. Math.eeil () : this function returns the smallest integer number which is greater than or equal to the number. The return type of this function is double. 2. Math.floor () : the return type of this fanction is double. This function returns the largest integer number which is less than or equal to the number. 3. Math.rint () : the return type of this function is double. This function returns the truncated value of a number. If number appears in the integer part is odd and in fractional 5|Page NIRMAL KUMAR JHA 8-Apr-20 Scanned with CamScannerNOTES OF BLUEJ STD: 1K CARMEL SCHOOL,GIRIDIH 10. Mu. 12. 13. 14. 15. 16. 17. 18. part is more than or equal to 5 , then | is being added to the integer part , otherwise it will return the integer part number. If in the integer part there is even number and in the fractional past it is more than 5 then 1 is being added to the integer part, otherwise it will return the integer part number only. Math.round( ) : return type of this function is int. Rounds off a double value by first adding 0.5 to it and then ceturning the largest integer that is less than or equal to this new value. Math.abs( ): return type of this function is double. Returns the absolute value of a number. Mathamax (a,b ) : Return type of this function is double-Takes two double values, a and », and returns the greater of the two. ‘Math.min( a,b) : Return type of this function is double. ‘Takes two double values, a and b, and returns the smaller of the two. Math.sqrt () : Return type of this function is double. Returns the square root of a number. Math.pow( a,b) : Return type of this function is double. Returns the value of a raised to the power b. Math.random () : Return type of this function is double. Generates a random number between 0.0 and 1.0. Math.exp (a ) : Return type of this function is double. Returns the exponential number e(2.718...) raised to the power of a Math.sin() : Retr type of this function is double, Returns the trigonometric sine of an angle in radian, Where radian = n/ 180*degree . Math.cos( ) : Return type of this function is double. Returns cosine value of an angle in radian. ‘Math.tan () : Reta type of this function is double. Returns tangent value of an angle in radian, Math.asin( ) : Return type of this function is double. Returns the angle whose sin is a Math, acos( ): Return type of this function is double. Returns the angle whose cos is a. ‘Math.atan () : Return type of this function is doable. Returns the angle whose tan is a. Math.og () : Return type of this function is double Returns the natural logarithm of a. String functions : |. String.toLowerCase ( lowercse. Return type of this function is String. 2. String.toUpperCase ( : returns string in uppercase. Return type of this function is String, 3. String.replace( charl,char2): returns string by zeplacing all the occurrences of charl by char2.. Return type of this function is String, 4. String.trim( ) : returns string after removing whitespaces from beginning and end of the string. Return type of this function is String, 5. String1. equals( string2) : returns true if string] and string? is equal otherwise returns false. Return type of this function is boolean. 6. String] equalslgnoreCase( string2) : returns true if string] and string? is equal otherwise returns false but it doesn’t consider the case while comparing strings. It does a case insensitive comparison, Return type of this function is boolean. 7. String.length( ) : retarns length of a string. Return type of this fanction is int. 6|Page NIRMAL KUMAR JHA 8-Apr-20 Scanned with CamScannerNOTES OF BLUES STD: Ik CARMEL SCHOOL, GIRIDIH 8. String.charAt () : returns a character at the specified index. Return type of this function is char. 9. Stringl.concat( string2) : Concatenates the specified string 2 at the end of the string Return type of this function is String. 10, String .substring(int beginIndex): It returns the substring of the string. The substring starts with the character at the specified index. Return type of this function is String. 11. String .substring(int beginIndex, int endIndex): Returns the substring. The substring starts with character at beginIndex and ends with the character at endindex. Return type of this function is String, 12, string . indexOf(char ch): Returns the index of first occurrence of the specified character ch in the string. Return type of this function is int. 13, String, indexOf(char ch, int fromlndex): Same as indexOf method however it starts searching in the string from the specified fromIndex. Return type of this function is int. 14. String. lastIndexOf(char ch): It returns the last occurrence of the character ch in the string. Return type of this function is int. 15, string. lastIndexOf(char_ch, int fromfndex): Same as lastIndexOf{int ch) method, it starts search from fromindex. Return type of this function is int, 16. Stringl. compareTo (string2) : compares the two strings and returns positive value if string] is greater than string2, seturns negative value if string] is smaller than string2 and returns 0 if both the strings are equal. Return type of this function is int. 17, String, startsWith( string prefix) : returns true if string is having specified prefix otherwise returns false. Return type of this function is boolean 18, String. startsWith( string prefix, int index) : returns true if the substring (starting from the specified index) is having the specified prefix otherwise returns false. Return type of this function is boolean. 19. String. endsWith(String suffix): Returns true if the string ends with the specified suffix otherwise returns false. Return type of this function is boolean. 20. Character.isLetter( ) : returns true if the specified char value is a letter otherwise false. Return type of this function is boolean. 21. Character.isDigit( ) ; returns true if the specified char value is a digit otherwise false. Return type of this function is boolean. 22. Character.isWhitespace( ) : returns true if the specified char value is whitespace otherwise false. Return type of this function is boolean. 23. Character. isUpperCase( ): returns true if the specified char is in upper case otherwise false. Return type of this function is boolean. 24. Character.isLowerCase( ) : returns true if the specified char value is in lower case otherwise false. Return type of this function is boolean. 25. Character.toUpperCase () : returns the uppercase form of specified char value. Return type of this function is char. 26. Character.toLowerCase ( ) : seturns the lowercase form of specified char value. Return type of this function is char. 27. Switch-case : It is a multiple branching statement. It transfers control to different parts of the code based on the value of an expression. Where expression can be either integer( byte,short,int) or character(char). In absence of break statement , execution will continue on into the next case statement i.e. fall through. 7|Page NIRMAL KUMAR JHA B-Apr-20 | Scanned with CamScannerNOTES OF BLUEJ STD: 1K CARMEL SCHOOL,GIRIDIH 31. 32. Difference between , switch-case and if-else: switch-case if-else Tt can only test for equality. Ttcan evaluate any type of boolean expression. Switch only Tooks for a match between the | If statement uses a series of expression having value of the expression and one of its case _| unrelated variables. constant values. Teruns much faster than the if-else-if Tis relatively slower than the switch-case, statement With switch statement floating point variables | If-else statement can use floating point and constants cannot be used. constant or variables. 33. Wrapper class : itis a collection of classes used to wrap variables of simple data type Boolean, Character,Float,Integer and Long are wrapper classes. Boxing :The object of the wrapper class contains or wraps its respective primitive data type. converting primitive data types into object is called boxing. Un boxing : the Wsapper object will be converted back to a primitive data type, and process is called un boxing. ‘What are the uses of scanner class? > Allows the user to input the values of various types, > This allows the user to input the values from either the keyboard or from file without using any conversion How will you import a scanner package ? > import java.util. Scanner; How will you create a scanner object ? > Scanner sc = new Scanner(System.in What is the use of nextInt()? > Receives the next token from scanner object > Can be expressed as an integer and stored in integer type What is the use of nextFloat()? > Receives the next token from scanner object > Can be expressed as an floating and stored in float type What is the use of nextLong()? > Receives the next token from scanner object > Can be expressed as an long and stored in long type What is the use of nextDouble()? > Receives the next token from scanner object > Can be expressed as an double and stored in double type ‘What is the use of next()? > Receives the next token from scanner object as a string What is the use of nextline()? > Receives the entire line of the string 8|Page NIRMAL KUMAR JHA 8-Apr-20 Scanned with CamScannerNOTES OF BLUE STD: 1K CARMEL SCHOOL,GIRIDIH Name the class that is used (0 read formatted input 2\ > Scanner How does a scanner read the data ? ‘© Scanner reads the input and breaks down the input into tokens © A token is a part of input that is separated from other tokens by separations (White spaces) ‘What are the rules to be followed while using scanner classes ? * Determine if a specitic type of the input is available or not(Using has Next methods) ‘© If input is available then read it by calling next method ‘+ _ Repeat the above process until ail tokens of input are read ‘What do you mean by input mismatch Exception ? > Scanner reads the numeric data throws an InputMismatchException, if the next token is not the value as expected by the method. What is the use of the function Boolean hasNextInt() ? ‘© Returns true if the next token in the scanner object can be interrupted as an int value What is the use of the function Boolean hasNextLong() ? © Returns true if the next token in the scanner object can be interrupted as a long value What is the use of the function Boolean hasNextDouble() ? ‘+ _ Returns true if the next token in the scanner object can be interrupted as a double value What is the use of the function Boolean hasNextFloat() ? ‘© _ Retarns true if the next token in the scanner object can be interrupted as a float value What is the use of the function Boolean hasNext() ? © Returns true if the scanner object has another token in its input otherwise false ‘What is the use of the function Boolean hasNextLine() ? ‘* Returns true if the scanner object has another line in its input otherwise false What are printer writer classes ? ‘© One of the character based class © Itmakes our output more productive and standasd How will you create printer writer object ? PrintWriter prn = new PrintWriter(System.out,true); ‘What is the use of flushIfNewline ? Controls the java system to flush the output stream every time a newline character(\n) is output What are the methods used for printing in printer classes ? Print() and printinO) 9|Page NIRMAL KUMAR JHA 8-Apr-20 Scanned with CamScanner
You might also like
Values & Data Type Character Sets
PDF
No ratings yet
Values & Data Type Character Sets
6 pages
Java Cheatsheet CodeWithHarry
PDF
0% (1)
Java Cheatsheet CodeWithHarry
18 pages
Java Cheatsheet - CodeWithHarry
PDF
No ratings yet
Java Cheatsheet - CodeWithHarry
18 pages
Java Revision Tour
PDF
No ratings yet
Java Revision Tour
13 pages
Computer Java Introduction For Class 9 Icse
PDF
100% (3)
Computer Java Introduction For Class 9 Icse
12 pages
02a Java Basics
PDF
No ratings yet
02a Java Basics
47 pages
Java Cheatsheet
PDF
No ratings yet
Java Cheatsheet
23 pages
Class 10 Computer Notes
PDF
No ratings yet
Class 10 Computer Notes
163 pages
Java Report
PDF
No ratings yet
Java Report
110 pages
CSC 201-Lecture 3
PDF
No ratings yet
CSC 201-Lecture 3
39 pages
Cheats Sheet All Topics
PDF
No ratings yet
Cheats Sheet All Topics
8 pages
Computer Application Keynotes
PDF
No ratings yet
Computer Application Keynotes
11 pages
Computer Application 3
PDF
No ratings yet
Computer Application 3
4 pages
Notes of Bluej For STD 10
PDF
100% (2)
Notes of Bluej For STD 10
17 pages
Nirmal Jha Notes
PDF
No ratings yet
Nirmal Jha Notes
17 pages
Java Language Fundamentals Complete Notes (Genie Ashwani)
PDF
No ratings yet
Java Language Fundamentals Complete Notes (Genie Ashwani)
19 pages
Basics Theory
PDF
No ratings yet
Basics Theory
7 pages
Computer Study Plan (STD 9)
PDF
No ratings yet
Computer Study Plan (STD 9)
7 pages
Week10 String Class
PDF
No ratings yet
Week10 String Class
22 pages
Java Unit 2
PDF
No ratings yet
Java Unit 2
76 pages
Week11 Character Class
PDF
No ratings yet
Week11 Character Class
32 pages
Flow of Control
PDF
No ratings yet
Flow of Control
22 pages
Comp Notes
PDF
No ratings yet
Comp Notes
23 pages
Java Q Spider
PDF
No ratings yet
Java Q Spider
39 pages
Basics
PDF
No ratings yet
Basics
51 pages
C Assigment
PDF
No ratings yet
C Assigment
9 pages
03 C Basics
PDF
No ratings yet
03 C Basics
33 pages
Java Programming
PDF
No ratings yet
Java Programming
66 pages
Java Notes1
PDF
No ratings yet
Java Notes1
6 pages
Module 2 - Java Notes
PDF
No ratings yet
Module 2 - Java Notes
33 pages
02 - Primitive Data Types
PDF
No ratings yet
02 - Primitive Data Types
51 pages
Inf 3
PDF
No ratings yet
Inf 3
9 pages
.WSU Chapter 2 Wsu - 1680847342000
PDF
No ratings yet
.WSU Chapter 2 Wsu - 1680847342000
34 pages
CMPT 125 Study Notes
PDF
No ratings yet
CMPT 125 Study Notes
46 pages
PPTDay 1
PDF
No ratings yet
PPTDay 1
35 pages
Unit 2 Test Review ICS3U 2025
PDF
No ratings yet
Unit 2 Test Review ICS3U 2025
15 pages
Java Fundamentals
PDF
No ratings yet
Java Fundamentals
50 pages
Unit 2
PDF
No ratings yet
Unit 2
56 pages
Programming Building Blocks - Java Basics
PDF
No ratings yet
Programming Building Blocks - Java Basics
51 pages
CSC 233 Lecture Slides
PDF
No ratings yet
CSC 233 Lecture Slides
103 pages
Computer Science - Introduction To Java ISC Notes
PDF
100% (3)
Computer Science - Introduction To Java ISC Notes
10 pages
Java Cheatsheet
PDF
No ratings yet
Java Cheatsheet
9 pages
Ssssssssuuuuuùusssszz 865 DB 06 C 24 C 71 D 789280526
PDF
No ratings yet
Ssssssssuuuuuùusssszz 865 DB 06 C 24 C 71 D 789280526
4 pages
Data Types
PDF
No ratings yet
Data Types
55 pages
9th Revise
PDF
No ratings yet
9th Revise
16 pages
Computer Programming
PDF
No ratings yet
Computer Programming
9 pages
4learning The Java Language1
PDF
No ratings yet
4learning The Java Language1
36 pages
Cha 2 Java
PDF
No ratings yet
Cha 2 Java
75 pages
Studentnotes C
PDF
No ratings yet
Studentnotes C
29 pages
Class10notes 2024
PDF
No ratings yet
Class10notes 2024
11 pages
Pearson Java Notes
PDF
No ratings yet
Pearson Java Notes
74 pages
Getting Input From Input Dialog Boxes: - Byte, Short, Int, Long, Float, Double, Char, Boolean
PDF
No ratings yet
Getting Input From Input Dialog Boxes: - Byte, Short, Int, Long, Float, Double, Char, Boolean
59 pages
Java Basic Notes March 14 Final
PDF
No ratings yet
Java Basic Notes March 14 Final
42 pages
Fundamentals
PDF
No ratings yet
Fundamentals
48 pages
Java / Blue J: Nasir Umer Computer Applications
PDF
No ratings yet
Java / Blue J: Nasir Umer Computer Applications
18 pages
Short Notes (Eng)
PDF
No ratings yet
Short Notes (Eng)
15 pages
Computer
PDF
No ratings yet
Computer
20 pages