In this you learn about Control Statements
1. Selection Statements
i. If
ii. If-else
iii. Nested-if
iv. If-Elseif ladder
2. Looping Statements
i. while loop
ii. do-while loop
iii. For loop
3. Jumping Statements
i. break
ii. continue
iii return
This document discusses various control flow statements in Java including branching statements, looping statements, and jump statements. It provides examples of if, if-else, if-else-if statements, switch statements, for loops, while loops, do-while loops, break, continue, and return statements. Key points include:
- Branching statements like if, if-else, if-else-if are used to control program flow based on boolean conditions. Switch statements provide an alternative for multiple if-else statements.
- Looping statements like for, while, do-while repeat a block of code while/until a condition is met.
- Jump statements like break and continue control flow within loops, while
The final keyword in Java can be applied to variables, methods, and classes. It restricts changes to final entities. Final variables must be initialized after declaration and their values cannot be changed. Final methods cannot be overridden in subclasses. Final classes cannot be subclassed. Blank final variables are not initialized in their declaration and can only be initialized in a constructor or static block.
This keyword is a reference variable that refer the current object in java.
This keyword can be used for call current class constructor.
http://www.tutorial4us.com/java/java-this-keyword
This document provides an overview of basic object-oriented programming (OOP) concepts including objects, classes, inheritance, polymorphism, encapsulation, and data abstraction. It defines objects as entities with both data (characteristics) and behavior (operations). Classes are blueprints that are used to create objects. Inheritance allows objects to inherit properties from parent classes. Polymorphism allows code to take different forms. Encapsulation wraps data and functions into classes, hiding information. Data abstraction focuses on important descriptions without details.
The document discusses key concepts in Java including classes, objects, methods, and command line arguments. A class defines common properties and behaviors for objects through fields and methods. Objects are instantiated from classes and can access fields and methods using dot notation. Command line arguments allow passing data into a Java application and are accessed through the args parameter in the main method.
- Java inner classes are classes declared within other classes or interfaces. They allow grouping of logically related classes and interfaces and can access all members of the outer class, including private ones.
- There are three main advantages of inner classes: they can access private members of the outer class, they make code more readable by grouping related classes, and they require less code.
- The two types of inner classes are non-static (inner) classes and static nested classes. Non-static classes can access outer class members like private variables while static classes cannot access non-static members only static ones.
- Examples demonstrate member inner classes, anonymous inner classes, local inner classes, and static nested classes in Java and how they can
Every value in Java has a data type. Java supports two kinds of data types: primitive data types and reference data types. Primitive data types represent atomic, indivisible values. Java has eight Numeric data types: byte, short, int,
An operator is a symbol that is used to perform some type of computation on its operands. Java contains a rich set of
operators. Operators are categorized as unary, binary, or ternary based on the number of operands they take. They are categorized as arithmetic, relational, logical, etc. based on the operation they perform on their operands.
long, float, double, char, and boolean. Literals of primitive data types are constants. Reference data types represent
references of objects in memory. Java is a statically typed programming language. That is, it checks the data types of all values at compile time.
The document discusses exception handling in programming. It defines different types of errors like syntax errors, semantic errors, and logical errors. Runtime errors can occur due to issues like division by zero. Exception handling involves finding and throwing exceptions using try, catch, and throw keywords. The catch block handles the exception. Common Java exceptions include NullPointerException, FileNotFoundException, and ArrayIndexOutOfBoundsException.
Operator overloading allows operators like + and - to be used with custom class and struct types by defining them as methods. It overloads their original meaning for built-in types while retaining that functionality. Binary operators take two parameters while unary operators take one. Overloading improves code readability and makes operations on custom types look more natural. However, overloading is limited to certain predefined operators and cannot change properties like precedence.
Access modifiers in Java control the accessibility and inheritance of classes, methods, and fields. There are three main access modifiers: private, protected, and public. Private members can only be accessed within their own class, protected within the package and subclasses, and public anywhere. Access modifiers also impact inheritance, with private members not being inherited by subclasses while protected and public can be.
This document provides an introduction to exception handling in programming. It discusses that exceptions are unusual runtime conditions, like division by zero, that a program may encounter during execution. It explains that code that could cause exceptions is placed in a try block. When an exception occurs in the try block, it is thrown using a throw statement. The catch block then handles the exception by generating user-friendly error messages. The document provides the syntax for try, throw, and catch blocks and includes an example program that catches a division by zero exception.
This is the presentation file about inheritance in java. You can learn details about inheritance and method overriding in inheritance in java. I think it's can help your. Thank you.
This document provides an overview of object-oriented programming concepts in Java including inheritance, polymorphism, abstraction, and encapsulation. It also discusses control structures like if/else statements and switches as well as repetition structures like while, do-while, and for loops. Arithmetic operations in Java like addition, subtraction, multiplication, and division are also mentioned.
This document discusses exception handling in C++ and Java. It defines what exceptions are and explains that exception handling separates error handling code from normal code to make programs more readable and robust. It covers try/catch blocks, throwing and catching exceptions, and exception hierarchies. Finally, it provides an example of implementing exception handling in a C++ program to handle divide-by-zero errors.
This document discusses inter-thread communication in Java. It explains that inter-thread communication allows threads to communicate with each other using the wait(), notify(), and notifyAll() methods of the Object class. It provides details on how each method works, when they should be called, and how they allow threads to transition between waiting, notified, and running states. The document also provides a code example to demonstrate how wait() and notify() can be used to coordinate threads accessing a shared resource.
Java abstract class & abstract methods,Abstract class in java
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.
This document discusses Java packages, including built-in and user-defined packages, advantages of packages, and how to access classes from other packages. Packages organize classes and interfaces, provide access protection, and avoid naming collisions. There are several ways to access classes from other packages, including importing the entire package, a specific class, or using the fully qualified class name. Subpackages further categorize packages. Class files can be loaded temporarily via the classpath or permanently by modifying environment variables or creating JAR files.
the slide about Exception handling in java and the file and io handling in java .inbuilt java packages in for java exception.for beginner in programming
This document discusses Java file input/output and streams. It covers the core stream classes like InputStream, OutputStream, Reader and Writer and their subclasses. File and FileInputStream/FileOutputStream allow working with files and directories on the file system. The key abstraction is streams, which are linked to physical devices and provide a way to send and receive data through classes that perform input or output of bytes or characters.
Pure virtual function and abstract classAmit Trivedi
This document discusses pure virtual functions and abstract classes. It provides an introduction and schedule, then covers rules for virtual functions, pure virtual functions, virtual base classes, virtual destructors, abstract classes, and limitations of virtual functions. It also discusses the difference between early binding and late binding.
The document discusses the structure of a Java program. A Java program contains classes, with one class containing a main method that acts as the starting point. Classes contain data members and methods that operate on the data. Methods contain declarations and executable statements. The structure also includes sections for documentation, package statements, import statements, interface statements, and class definitions, with the main method class being essential.
There are three types of variables in Java: local, instance, and class/static variables. Local variables are declared within methods and can only be accessed within that method. Instance variables are declared within a class but outside of methods, and can be accessed by any non-static method of that class. Class/static variables are also declared within a class but with the static keyword, and can be accessed from both static and non-static contexts.
The document discusses the super keyword, final keyword, and interfaces in Java.
- The super keyword is used to refer to the immediate parent class and can be used with variables, methods, and constructors. It allows accessing members of the parent class from the child class.
- The final keyword can be used with variables, methods, and classes. It makes variables constant and prevents overriding of methods and inheritance of classes.
- Interfaces in Java allow achieving abstraction and multiple inheritance. They can contain only abstract methods and variables declared with default access modifiers. Classes implement interfaces to provide method definitions.
This document discusses exception handling in C++. It defines an exception as an event that occurs during program execution that disrupts normal flow, like divide by zero errors. Exception handling allows the program to maintain normal flow even after errors by catching and handling exceptions. It describes the key parts of exception handling as finding problems, throwing exceptions, catching exceptions, and handling exceptions. The document provides examples of using try, catch, and throw blocks to handle exceptions in C++ code.
This document provides an overview of exception handling in Java. It discusses what exceptions are, what happens when exceptions occur, benefits of Java's exception handling framework such as separating error handling code and propagating exceptions up the call stack. It also covers catching exceptions using try-catch and finally blocks, throwing custom exceptions, the exception class hierarchy, and differences between checked and unchecked exceptions. The document concludes with a discussion of assertions.
The document discusses the static keyword in Java and its uses for variables, methods, blocks and nested classes. It explains that static members belong to the class rather than instances, and provides examples of static variables, methods, blocks and how they work. Key points include static variables having only one copy in memory and being shared across instances, static methods that can be called without an instance, and static blocks that initialize static fields when the class loads.
This document provides an overview of key concepts in Java programming including classes, methods, variables, data types, control flow statements, and arrays. It explains the structure and purpose of a basic Java class, describes Java's primitive data types and how to declare variables, and gives examples of if/else, for loops, and one-dimensional arrays. The summary covers the core elements needed to understand basic Java programs.
This document provides an introduction to the Java programming language. It discusses Java's evolution and history from 1991 to present. It also covers Java fundamentals including data types, operators, decision making and looping constructs, classes and objects, arrays and strings. The document is intended as an overview of the major topics and features in Java.
The document discusses exception handling in programming. It defines different types of errors like syntax errors, semantic errors, and logical errors. Runtime errors can occur due to issues like division by zero. Exception handling involves finding and throwing exceptions using try, catch, and throw keywords. The catch block handles the exception. Common Java exceptions include NullPointerException, FileNotFoundException, and ArrayIndexOutOfBoundsException.
Operator overloading allows operators like + and - to be used with custom class and struct types by defining them as methods. It overloads their original meaning for built-in types while retaining that functionality. Binary operators take two parameters while unary operators take one. Overloading improves code readability and makes operations on custom types look more natural. However, overloading is limited to certain predefined operators and cannot change properties like precedence.
Access modifiers in Java control the accessibility and inheritance of classes, methods, and fields. There are three main access modifiers: private, protected, and public. Private members can only be accessed within their own class, protected within the package and subclasses, and public anywhere. Access modifiers also impact inheritance, with private members not being inherited by subclasses while protected and public can be.
This document provides an introduction to exception handling in programming. It discusses that exceptions are unusual runtime conditions, like division by zero, that a program may encounter during execution. It explains that code that could cause exceptions is placed in a try block. When an exception occurs in the try block, it is thrown using a throw statement. The catch block then handles the exception by generating user-friendly error messages. The document provides the syntax for try, throw, and catch blocks and includes an example program that catches a division by zero exception.
This is the presentation file about inheritance in java. You can learn details about inheritance and method overriding in inheritance in java. I think it's can help your. Thank you.
This document provides an overview of object-oriented programming concepts in Java including inheritance, polymorphism, abstraction, and encapsulation. It also discusses control structures like if/else statements and switches as well as repetition structures like while, do-while, and for loops. Arithmetic operations in Java like addition, subtraction, multiplication, and division are also mentioned.
This document discusses exception handling in C++ and Java. It defines what exceptions are and explains that exception handling separates error handling code from normal code to make programs more readable and robust. It covers try/catch blocks, throwing and catching exceptions, and exception hierarchies. Finally, it provides an example of implementing exception handling in a C++ program to handle divide-by-zero errors.
This document discusses inter-thread communication in Java. It explains that inter-thread communication allows threads to communicate with each other using the wait(), notify(), and notifyAll() methods of the Object class. It provides details on how each method works, when they should be called, and how they allow threads to transition between waiting, notified, and running states. The document also provides a code example to demonstrate how wait() and notify() can be used to coordinate threads accessing a shared resource.
Java abstract class & abstract methods,Abstract class in java
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.
This document discusses Java packages, including built-in and user-defined packages, advantages of packages, and how to access classes from other packages. Packages organize classes and interfaces, provide access protection, and avoid naming collisions. There are several ways to access classes from other packages, including importing the entire package, a specific class, or using the fully qualified class name. Subpackages further categorize packages. Class files can be loaded temporarily via the classpath or permanently by modifying environment variables or creating JAR files.
the slide about Exception handling in java and the file and io handling in java .inbuilt java packages in for java exception.for beginner in programming
This document discusses Java file input/output and streams. It covers the core stream classes like InputStream, OutputStream, Reader and Writer and their subclasses. File and FileInputStream/FileOutputStream allow working with files and directories on the file system. The key abstraction is streams, which are linked to physical devices and provide a way to send and receive data through classes that perform input or output of bytes or characters.
Pure virtual function and abstract classAmit Trivedi
This document discusses pure virtual functions and abstract classes. It provides an introduction and schedule, then covers rules for virtual functions, pure virtual functions, virtual base classes, virtual destructors, abstract classes, and limitations of virtual functions. It also discusses the difference between early binding and late binding.
The document discusses the structure of a Java program. A Java program contains classes, with one class containing a main method that acts as the starting point. Classes contain data members and methods that operate on the data. Methods contain declarations and executable statements. The structure also includes sections for documentation, package statements, import statements, interface statements, and class definitions, with the main method class being essential.
There are three types of variables in Java: local, instance, and class/static variables. Local variables are declared within methods and can only be accessed within that method. Instance variables are declared within a class but outside of methods, and can be accessed by any non-static method of that class. Class/static variables are also declared within a class but with the static keyword, and can be accessed from both static and non-static contexts.
The document discusses the super keyword, final keyword, and interfaces in Java.
- The super keyword is used to refer to the immediate parent class and can be used with variables, methods, and constructors. It allows accessing members of the parent class from the child class.
- The final keyword can be used with variables, methods, and classes. It makes variables constant and prevents overriding of methods and inheritance of classes.
- Interfaces in Java allow achieving abstraction and multiple inheritance. They can contain only abstract methods and variables declared with default access modifiers. Classes implement interfaces to provide method definitions.
This document discusses exception handling in C++. It defines an exception as an event that occurs during program execution that disrupts normal flow, like divide by zero errors. Exception handling allows the program to maintain normal flow even after errors by catching and handling exceptions. It describes the key parts of exception handling as finding problems, throwing exceptions, catching exceptions, and handling exceptions. The document provides examples of using try, catch, and throw blocks to handle exceptions in C++ code.
This document provides an overview of exception handling in Java. It discusses what exceptions are, what happens when exceptions occur, benefits of Java's exception handling framework such as separating error handling code and propagating exceptions up the call stack. It also covers catching exceptions using try-catch and finally blocks, throwing custom exceptions, the exception class hierarchy, and differences between checked and unchecked exceptions. The document concludes with a discussion of assertions.
The document discusses the static keyword in Java and its uses for variables, methods, blocks and nested classes. It explains that static members belong to the class rather than instances, and provides examples of static variables, methods, blocks and how they work. Key points include static variables having only one copy in memory and being shared across instances, static methods that can be called without an instance, and static blocks that initialize static fields when the class loads.
This document provides an overview of key concepts in Java programming including classes, methods, variables, data types, control flow statements, and arrays. It explains the structure and purpose of a basic Java class, describes Java's primitive data types and how to declare variables, and gives examples of if/else, for loops, and one-dimensional arrays. The summary covers the core elements needed to understand basic Java programs.
This document provides an introduction to the Java programming language. It discusses Java's evolution and history from 1991 to present. It also covers Java fundamentals including data types, operators, decision making and looping constructs, classes and objects, arrays and strings. The document is intended as an overview of the major topics and features in Java.
This document provides an overview of key Java concepts including: a brief history of Java; its platform independence and security features; data types like primitive, non-primitive, and reference types; variables and their scope; control structures like loops; methods and parameters/arguments; and classes. It discusses Java naming conventions and provides examples of basic Java code constructs like loops, variables, and methods.
Java is a high-level programming language developed by Sun Microsystems. ... Instead, Java programs are interpreted by the Java Virtual Machine, or JVM, which runs on multiple platforms. This means all Java programs are multiplatform and can run on different platforms, including Macintosh, Windows, and Unix computers.
The document provides an overview of key concepts in the Java programming language including:
1. Java language fundamentals including building blocks like identifiers, literals, variables, and wrapper classes. Different types of literals like integral, floating point, character, string and boolean are described.
2. Control structures in Java including selection statements like if-else and switch statements, and iterative statements like while, do-while and for loops. Jump statements like break, continue and return are also covered.
3. Other concepts discussed include arrays, declaring and initializing array variables, and creating arrays using the new operator in Java.
This ppt describes basics of scala upto collections covering both object oriented and functional programming concepts of the language.
References:Scala cookbook
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptxIndu65
This document provides an introduction to Java programming language and some of its core concepts. It discusses:
- The origins and features of Java like being architecture neutral, robust, multithreaded, object-oriented, platform independent, simple and secure.
- Basic Java syntax including classes, objects, methods, and variables.
- Key object-oriented programming concepts in Java like encapsulation, inheritance, polymorphism and abstraction.
- Examples of basic Java programs and code snippets demonstrating classes, objects, methods, variables and data types.
- Common programming structures in Java like control statements, operators, and constructors.
This document provides an overview of imperative programming languages (IPL). Some key points:
- IPLs closely resemble the architectural structure of computers and manipulate values and machine states. They use constructs like procedures, functions, variables, and sequential statements.
- Examples of IPLs include FORTRAN, COBOL, Pascal, C/C++, BASIC, and Java. They are based on the von Neumann architecture and instruction set of CPUs.
- IPL characteristics include variables, procedures/function calls, sequential/conditional/iterative statements, and side effects from statement order. Variables abstract memory storage.
The document discusses various Java programming concepts including comments, identifiers, keywords, primitive data types, variables, objects, and access modifiers. It provides examples and definitions for each concept. The key points covered are the eight primitive data types in Java (boolean, char, byte, short, int, long, float, double), how to declare and initialize variables, how to construct objects using the new keyword, and the differences between public, private, protected, default, final, and abstract access modifiers.
This document provides an overview of key concepts in Java programming including:
1) The components of a Java program such as statements, blocks, classes, and methods.
2) How to structure Java source code files with classes and the main method.
3) Common elements in Java programs like variables, data types, operators, and comments.
4) Details on specific concepts like declaring and initializing variables, arithmetic operators, and increment/decrement operators.
The document discusses various control structures and functions used in Arduino programming including decision making structures like if, else if, else statements and switch case statements. It also covers different types of loops like while, do-while and for loops that allow repeating blocks of code. Functions are described as reusable blocks of code that perform tasks and help organize a program. Strings can be implemented as character arrays or using the String class, and various string functions are provided to manipulate and work with strings.
This document provides an overview of the Java programming language including how it works, its features, syntax, and input/output capabilities. Java allows software to run on any device by compiling code to bytecode that runs on a virtual machine instead of a particular computer architecture. It is an object-oriented language with features like automatic memory management, cross-platform capabilities, and a robust class library.
This document provides an overview of the Java programming language including how it works, its features, syntax, and input/output capabilities. Java allows software to run on any device by compiling code to bytecode that runs on a virtual machine. It is object-oriented, supports features like inheritance and polymorphism, and has memory management and security benefits over other languages. The document also discusses Java concepts like classes, methods, arrays, and streams for file input/output.
Himachal Pradesh’s beautiful hills have long faced a challenge: limited access to quality education and career opportunities for students in remote towns and villages. Many young people had to leave their homes in search of better learning and growth, creating a gap between talent and opportunity.
Vikas Bansal, a visionary leader, decided to change this by bringing education directly to the heart of the Himalayas. He founded the Himalayan Group of Professional Institutions, offering courses in engineering, management, pharmacy, law, and more. These institutions are more than just schools—they are centers of hope and transformation.
By introducing digital classrooms, smart labs, and practical workshops, Vikas ensures that students receive modern, high-quality education without needing to leave their hometowns. His skill development programs prepare youth for real-world careers by teaching technical and leadership skills, with strong industry partnerships and hands-on training.
Vikas also focuses on inclusivity, providing scholarships, career counseling, and support to underprivileged and first-generation learners. His quiet but impactful leadership is turning Himachal Pradesh into a knowledge hub, empowering a new generation to build a brighter future right in their own hills.
Battle of Bookworms is a literature quiz organized by Pragya, UEM Kolkata, as part of their cultural fest Ecstasia. Curated by quizmasters Drisana Bhattacharyya, Argha Saha, and Aniket Adhikari, the quiz was a dynamic mix of classical literature, modern writing, mythology, regional texts, and experimental literary forms. It began with a 20-question prelim round where ‘star questions’ played a key tie-breaking role. The top 8 teams moved into advanced rounds, where they faced audio-visual challenges, pounce/bounce formats, immunity tokens, and theme-based risk-reward questions. From Orwell and Hemingway to Tagore and Sarala Das, the quiz traversed a global and Indian literary landscape. Unique rounds explored slipstream fiction, constrained writing, adaptations, and true crime literature. It included signature IDs, character identifications, and open-pounce selections. Questions were crafted to test contextual understanding, narrative knowledge, and authorial intent, making the quiz both intellectually rewarding and culturally rich. Battle of Bookworms proved literature quizzes can be insightful, creative, and deeply enjoyable for all.
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptxArshad Shaikh
Wheat, sorghum, and bajra (pearl millet) are susceptible to various pests that can significantly impact crop yields. Common pests include aphids, stem borers, shoot flies, and armyworms. Aphids feed on plant sap, weakening the plants, while stem borers and shoot flies damage the stems and shoots, leading to dead hearts and reduced growth. Armyworms, on the other hand, are voracious feeders that can cause extensive defoliation and grain damage. Effective management strategies, including resistant varieties, cultural practices, and targeted pesticide applications, are essential to mitigate pest damage and ensure healthy crop production.
Completed Tuesday June 10th.
An Orientation Sampler of 8 pages.
It helps to understand the text behind anything. This improves our performance and confidence.
Your training will be mixed media. Includes Rehab Intro and Meditation vods, all sold separately.
Editing our Vods & New Shop.
Retail under $30 per item. Store Fees will apply. Digital Should be low cost.
I am still editing the package. I wont be done until probably July? However; Orientation and Lecture 1 (Videos) will be available soon. Media will vary between PDF and Instruction Videos.
Thank you for attending our free workshops. Those can be used with any Reiki Yoga training package. Traditional Reiki does host rules and ethics. Its silent and within the JP Culture/Area/Training/Word of Mouth. It allows remote healing but there’s limits for practitioners and masters. We are not allowed to share certain secrets/tools. Some content is designed only for “Masters”. Some yoga are similar like the Kriya Yoga-Church (Vowed Lessons). We will review both Reiki and Yoga (Master symbols) later on. Sounds Simple but these things host Energy Power/Protection.
Imagine This package will be a supplement or upgrade for professional Reiki. You can create any style you need.
♥♥♥
•* ́ ̈ ̧.•
(Job) Tech for students: In short, high speed is essential. (Space, External Drives, virtual clouds)
Fast devices and desktops are important. Please upgrade your technology and office as needed and timely. - MIA J. Tech Dept (Timeless)
♥♥♥
•* ́ ̈ ̧.•
Copyright Disclaimer 2007-2025+: These lessons are not to be copied or revised without the
Author’s permission. These Lessons are designed Rev. Moore to instruct and guide students on the path to holistic health and wellness.
It’s about expanding your Nature Talents, gifts, even Favorite Hobbies.
♥♥♥
•* ́ ̈ ̧.•
First, Society is still stuck in the matrix. Many of the spiritual collective, say the matrix crashed. Its now collapsing. This means anything lower, darker realms, astral, and matrix are below 5D. 5D is thee trend. It’s our New Dimensional plane. However; this plane takes work ethic,
integration, and self discovery. ♥♥♥
•* ́ ̈ ̧.•
We don’t need to slave, mule, or work double shifts to fuse Reiki lol. It should blend naturally within our lifestyles. Same with Yoga. There’s no
need to use all the poses/asanas. For under a decade, my fav exercises are not asanas but Pilates. It’s all about Yoga-meditation when using Reiki. (Breaking old myths.)
Thank You for reading our Orientation Sampler. The Workshop is 14 pages on introduction. These are a joy and effortless to produce/make.
How to Manage Upselling of Subscriptions in Odoo 18Celine George
Subscriptions in Odoo 18 are designed to auto-renew indefinitely, ensuring continuous service for customers. However, businesses often need flexibility to adjust pricing or quantities based on evolving customer needs.
Exploring Ocean Floor Features for Middle SchoolMarie
This 16 slide science reader is all about ocean floor features. It was made to use with middle school students.
You can download the PDF at thehomeschooldaily.com
Thanks! Marie
"Geography Study Material for Class 10th" provides a comprehensive and easy-to-understand resource for key topics like Resources & Development, Water Resources, Agriculture, Minerals & Energy, Manufacturing Industries, and Lifelines of the National Economy. Designed as per the latest NCERT/JKBOSE syllabus, it includes notes, maps, diagrams, and MODEL question Paper to help students excel in exams. Whether revising for exams or strengthening conceptual clarity, this material ensures effective learning and high scores. Perfect for last-minute revisions and structured study sessions.
2. Variables
A variable is something which can hold some
value, or this is like a container for holding some
value; and off course this value is always subject
to change. The name of variable is always
preceded with the name of data type in JAVA.
For example
int speed=0;
Data type Name of variable
Value of variable
3. Type of variables in JAVA
The Java programming language defines the
following kinds of variables:
• Instance Variables (Non-Static Fields)
• Class Variables (Static Fields)
• Local Variables
• Parameters
4. Example(Type of Variables)
public class VariableDemo
{
int var1=0; //Each Instance of this class will have
//its own copy of this variable
static int var2=6; //Only one(common) copy of class variable will be
// available with all instances of this class
public void showArea(float r)
{
float pi=3.144f; // Local variable have local scope to that particular
// method or code of block(example for loop;)
System.out.println(“Area of circle is = ”+ pi*r*r);
}
}
Instance variable/Field/ object Variable
Class/static variable
Parameters
Local variable
5. Operators
Operators are special symbols that perform
specific operations on one, two, or
three operands, and then return a result
7. Expressions
An expression is a construct made up of
variables, operators, and method invocations,
which are constructed according to the syntax of
the language, that evaluates to a single value.
For example
int empId = 97312;
testArray[1] = 100;
System.out.println("Element 2at index 1: " +
testArray[0]);
8. Java programming language allows you to
construct compound expressions from various
smaller expressions
Like a*b*c;
However these can be ambiguous
Like a +b /100 Ambiguous, not
recommended
Or like (a+b)/100 Not Ambiguous,
recommended
Expressions must be balanced correctly using
parenthesis
9. Statements
Statements are roughly equivalent to sentences in
natural languages. A statement forms a complete
unit of execution. The following types of
expressions can be made into a statement by
terminating the expression with a semicolon (;).
• Assignment expressions // speed=107;
• Any use of ++ or -- //a++;
• Method invocations //c= obj.add(15,17);
• Object creation expressions //Cal obj=new Cal();
10. Blocks
if (condition) { // begin block 1
System.out.println("Condition is true.");
} // end block one
11. Control Flow Statements
The statements inside your source files are generally
executed from top to bottom, in the order that they
appear. Control flow statements, however, break up the
flow of execution by employing decision making, looping,
and branching, enabling our program
to conditionally execute particular blocks of code.
1. decision-making statements (if-then, if-then-
else, switch),
2. looping statements (for, while, do-while), 3.
3. branching statements (break, continue, return)
supported by the Java programming language.
12. if
• if(condition)statement;
• The condition is Boolean expression, its
outcome can be only true or false
• Relational operators like <,>,== can be used to
create condition
14. The switch Statement
Unlike if-then and if-then-else statements,
the switch statement can have a number of
possible execution paths. A switch works with
the byte, short, char, and int primitive data
types. It also works with enumerated types ,
the String class, and a few special classes that
wrap certain primitive
types: Character, Byte, Short, and Integer
15. Switch example
public class SwitchDemo {
public static void main(String[] args) {
int day = 3;
String day;
switch (month) {
case 1: day= “monday";
break;
case 2: day = “tuesday";
break;
case 3: day = “wednesday";
break;
case 4: day = “thrusday";
break;
case 5: day = “friday";
break;
default: day = “holiday";
break;
}
System.out.println(day);
}
}