Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Class notes java

Rating
-
Sold
-
Pages
460
Uploaded on
26-06-2023
Written in
2022/2023

Java Course Notes is a comprehensive and well-structured resource designed to support learners in mastering the Java programming language. These notes provide a clear and concise overview of fundamental concepts, syntax, and best practices, serving as a valuable reference for beginners and experienced programmers alike. With in-depth explanations and examples, the course notes cover topics such as variables, control structures, object-oriented programming, exception handling, and more. The notes are organized in a logical manner, making it easy to navigate and understand complex Java concepts. Whether you're studying independently or attending a Java course, these notes will enhance your understanding and serve as a valuable tool throughout your programming journey.

Show more Read less
Institution
Course

Content preview

Language Fundamentals
1. Identifiers
2. Reserved words
3. Data types
4. Literals
5. Arrays
6. Types of variabless
7. Var arg method
8. Main method
9. Command line arguments
10. Java coding standards
Identifier: A name in java program is called identifier. It may be class name, method name,
variable name and label name.
Example:




Rules to define java identifiers:
Rule 1: The only allowed characters in java identifiers are:
1) a to z
2) A to Z
3) 0 to 9
4) _
5) $
Rule 2: If we are using any other character we will get compile time error.
Example:
1) total_number-------valid
2) Total#------------------invalid
Rule 3: identifiers are not allowed to starts with digit.
Example:
1) ABC123---------valid
2) 123ABC---------invalid
Rule 4: java identifiers are case sensitive up course java language itself treated as case sensitive
language.



1

,Example:
class Test{
int number=10;
int Number=20;
int NUMBER=20; we can differentiate with case.
int NuMbEr=30;
}]
Rule 5: There is no length limit for java identifiers but it is not recommended to take more than
15 lengths.
Rule 6: We can’t use reserved words as identifiers.
Example: int if=10; --------------invalid
Rule 7: All predefined java class names and interface names we use as identifiers.
Example 1:
class Test
{
public static void main(String[] args){
int String=10;
System.out.println(String);
}}
Output:
10
Example 2:
class Test
{
public static void main(String[] args){
int Runnable=10;
System.out.println(Runnable);
}}
Output:
10
Even though it is legal to use class names and interface names as identifiers but it is not a good
programming practice.
Which of the following are valid java identifiers?




2

,Reserved words:
• In java some identifiers are reserved to associate some functionality or meaning such
type of reserved identifiers are called reserved words.
Diagram:




Reserved words for data types:
1) byte
2) short
3) int
4) long
5) float
6) double
7) char
8) boolean
Reserved words for flow control:
1) if
2) else
3) switch
4) case
5) default
6) for
7) do


3

, 8) while
9) break
10) continue
11) return
Keywords for modifiers:
1) public
2) private
3) protected
4) static
5) final
6) abstract
7) synchronized
8) native
9) strictfp(1.2 version)
10) transient
11) volatile
Keywords for exception handling:
1) try
2) catch
3) finally
4) throw
5) throws
6) assert(1.4 version)
Class related keywords:
1) class
2) package
3) import
4) extends
5) implements
6) interface
Object related keywords:
1) new
2) instanceof
3) super
4) this
Void return type keyword:
• If a method won’t return anything compulsory that method should be declared with the
void return type in java but it is optional in C++.

4

Written for

Course

Document information

Uploaded on
June 26, 2023
Number of pages
460
Written in
2022/2023
Type
Class notes
Professor(s)
Durga mam
Contains
All classes

Subjects

$5.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
rakabhaiya01

Get to know the seller

Seller avatar
rakabhaiya01 shri shankaracharya technical campus
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
24
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions