Institute: Uie Department: Cse: Bachelor of Engineering (Computer Science & Engineering)
Institute: Uie Department: Cse: Bachelor of Engineering (Computer Science & Engineering)
DEPARTMENT : CSE
Bachelor of Engineering (Computer Science &
Engineering)
• Java application programming interface (API) is a list of all classes that are part of
the Java development kit (JDK).
• It includes all Java packages, classes, and interfaces, along with their methods, fields,
and constructors.
• These prewritten classes provide a tremendous amount of Built-in Packages.
• The Java API is a library of prewritten classes which contains components for managing
input, database programming.
• The library is divided into packages and classes i.e you can either import a single class
or a whole package that contain all the classes that belong to the specified package.
• To use a class or a package from the library, you need to use the import keyword.
Understanding of .class file
concept
Sample.java file contains class A, B and C.
How many .class files will be created after compiling Sample.java?
Sample.java
class A { What is your
observation?
void m1() { }
}
class B {
void m2() { }
}
class C {
void m3() { }
}
Difference between class,
object, methods, and instance
variables?
(b) try, catch, and thrown are keywords in the Java language.
(c) static, unsigned, and long are keywords in the Java language.
(d) exit, class, and while are keywords in the Java language.
(e) return, goto, and default are keywords in the Java language.
(f) for, while, and next are keywords in the Java language.
9
Java Operators
An operator is a symbol that tells the
compiler to perform a specific
mathematical or logical
manipulation. Arithmetic
Bitwise
Classes of
Operators
Logical
Relational
ARITHMATIC OPERATORS
RELATIONAL OPERATORS
LOGICAL OPERATORS
11
Can you identify the output for the
below code?
Source:
Java™
A Beginner’s
Guide 12
Sixth Edition ,
Identifiers in java
• In programming languages, identifiers are used for
identification purpose.
• In Java, an identifier can be a class name, method name,
variable name or a label.
• For example :public class Test { public static void main(String[]
args) { int a = 20; } }
• Tied to a method
Local Variables • Scope of a local variable is within the method
• Tied to a class
Static Variables • Shared by all instances of a class
Data Types
Understanding of data type concepts
What will be the result, if we try to compile and execute the following??
code?
class Test {
public static void main(String [ ] ar) {
byte b=128;
System.out.println(b);
}
}
QUIZ
1. Which of the following do not denote a primitive data value in Java? Select the
two correct answers.
(a) "t"
(b) 'k‘
(c) 50.5F
(d) "hello"
(e) false 2.5
QUIZ
2. Which of the following primitive data types are not integer types? Select the
three correct answers.
(a) boolean
(b) byte
(c) float
(d) short
(e) double
Summary:
1. Balaguruswamy, Java.
2. A Primer, E.Balaguruswamy, Programming
with Java, Tata McGraw Hill Companies
3. John P. Flynt Thomson, Java Programming.
Video Lectures :
https://www.youtube.com/watch?v=0MFC_Vw
9NxY
E-book :
https://www.learnjavaonline.org/
THANK YOU