Intro to JAVA
Basics of Oops
Features of Oops
Applications of Oops
How to create a JAVA program
How to Edit a Java Program
Compiling a Java program
Java Class file
Run or Executing a Java program
Command line arguments
Imran Sarwar Bajwa, [2010], "Context Based Meaning Extraction by Means of Markov Logic", in International Journal of Computer Theory and Engineering - (IJCTE) 2(1) pp:35-38, February 2010
Imran Sarwar Bajwa, [2010], "Context Based Meaning Extraction by Means of Markov Logic", in International Journal of Computer Theory and Engineering - (IJCTE) 2(1) pp:35-38, February 2010
The course aims to provide you with an understanding of the fundamental concepts involved in object-oriented programming (object, class, protocol, hierarchy, inheritance, encapsulation, polymorphism and collaboration).
The programming language you will use is Java. However, the purpose of the course is not to teach you the minutiae of the Java language, but rather to teach you fundamental object-oriented programming concepts and skills that will be transferable to any object¬ oriented language
"Object Oriented Programming in Python" presentation for the "Dynamic Programming Languages" subject by Juan Manuel Gimeno Illa at University of Lleida
Language Identifier for Languages of Pakistan Including Arabic and PersianWaqas Tariq
Language recognizer/identifier/guesser is the basic application used by humans to identify the language of a text document. It takes simply a file as input and after processing its text, decides the language of text document with precision using LIJ-I, LIJ-II and LIJ-III. LIJ-I results in poor accuracy and strengthen with the use of LIJ-II which is further boosted towards a higher level of accuracy with the use of LIJ-III. It also helps in calculating the probability of digrams and the average percentages of accuracy. LIJ-I considers the complete character sets of each language while the LIJ-II considers only the difference. A JAVA based language recognizer is developed and presented in this paper in detail.
A Portable Approach for Bidirectional Integration between a Logic and a Stati...Sergio Castro
This dissertation seeks to improve on the state of the art for creating systems integrating modules written in both a logic and a statically-typed object-oriented language. Logic languages are well suited for declaratively solving computational problems that require knowledge representation and reasoning. Modern object-oriented programming languages benefit from mature software ecosystems featuring rich libraries and developer tools. The existence of several integration approaches testifies the interest of both communities in techniques for facilitating the creation of hybrid systems. In this way, systems developed in an object-oriented language can integrate modules written in a logic language that are more convenient for solving declarative problems. On the logic side, non-trivial declarative applications can take advantage of the existence of large software ecosystems such as those surrounding contemporary object-oriented languages. The combination of both paradigms allows a programmer to use the best language available for a given task. Existing integration approaches provide different levels of abstractions for dealing with the integration concern (i.e., the required interoperability in order for logic routines to access the object-oriented world, and vice versa). Some of them still require significant amounts of boilerplate code which hinders their adoption and steepens their learning curve. Others provide a high degree of integration transparency and automation which simplifies their usage. However, many of those approaches often impose strong assumptions about the architecture of a system (e.g., a logic program must run embedded in an object-oriented one) thus suffering from portability issues. Furthermore, most approaches provide limited support for custom context-dependent reification of objects in the logic world and custom mappings of arbitrary logic terms to objects in the object-oriented world. To address these problems, we introduce our portable and customisable approach for bidirectional integration between a logic and a statically-typed object-oriented language. This approach enables a transparent and (semi-) automatic communication between routines in these two worlds. In addition, it provides a customisable context-dependent mechanism for defining how artefacts in one language should be reified in the other language. A concrete implementation is provided as a portable Java--Prolog interoperability framework. To ensure portability, our framework has been made compatible with three open source Prolog engines (SWI, YAP and XSB) by means of drivers. We validated our approach through case studies requiring a seamless integration of declarative programs in Prolog with object-oriented programs in Java.
The course aims to provide you with an understanding of the fundamental concepts involved in object-oriented programming (object, class, protocol, hierarchy, inheritance, encapsulation, polymorphism and collaboration).
The programming language you will use is Java. However, the purpose of the course is not to teach you the minutiae of the Java language, but rather to teach you fundamental object-oriented programming concepts and skills that will be transferable to any object¬ oriented language
"Object Oriented Programming in Python" presentation for the "Dynamic Programming Languages" subject by Juan Manuel Gimeno Illa at University of Lleida
Language Identifier for Languages of Pakistan Including Arabic and PersianWaqas Tariq
Language recognizer/identifier/guesser is the basic application used by humans to identify the language of a text document. It takes simply a file as input and after processing its text, decides the language of text document with precision using LIJ-I, LIJ-II and LIJ-III. LIJ-I results in poor accuracy and strengthen with the use of LIJ-II which is further boosted towards a higher level of accuracy with the use of LIJ-III. It also helps in calculating the probability of digrams and the average percentages of accuracy. LIJ-I considers the complete character sets of each language while the LIJ-II considers only the difference. A JAVA based language recognizer is developed and presented in this paper in detail.
A Portable Approach for Bidirectional Integration between a Logic and a Stati...Sergio Castro
This dissertation seeks to improve on the state of the art for creating systems integrating modules written in both a logic and a statically-typed object-oriented language. Logic languages are well suited for declaratively solving computational problems that require knowledge representation and reasoning. Modern object-oriented programming languages benefit from mature software ecosystems featuring rich libraries and developer tools. The existence of several integration approaches testifies the interest of both communities in techniques for facilitating the creation of hybrid systems. In this way, systems developed in an object-oriented language can integrate modules written in a logic language that are more convenient for solving declarative problems. On the logic side, non-trivial declarative applications can take advantage of the existence of large software ecosystems such as those surrounding contemporary object-oriented languages. The combination of both paradigms allows a programmer to use the best language available for a given task. Existing integration approaches provide different levels of abstractions for dealing with the integration concern (i.e., the required interoperability in order for logic routines to access the object-oriented world, and vice versa). Some of them still require significant amounts of boilerplate code which hinders their adoption and steepens their learning curve. Others provide a high degree of integration transparency and automation which simplifies their usage. However, many of those approaches often impose strong assumptions about the architecture of a system (e.g., a logic program must run embedded in an object-oriented one) thus suffering from portability issues. Furthermore, most approaches provide limited support for custom context-dependent reification of objects in the logic world and custom mappings of arbitrary logic terms to objects in the object-oriented world. To address these problems, we introduce our portable and customisable approach for bidirectional integration between a logic and a statically-typed object-oriented language. This approach enables a transparent and (semi-) automatic communication between routines in these two worlds. In addition, it provides a customisable context-dependent mechanism for defining how artefacts in one language should be reified in the other language. A concrete implementation is provided as a portable Java--Prolog interoperability framework. To ensure portability, our framework has been made compatible with three open source Prolog engines (SWI, YAP and XSB) by means of drivers. We validated our approach through case studies requiring a seamless integration of declarative programs in Prolog with object-oriented programs in Java.
Introduction to C++ : Object Oriented Technology, Advantages of OOP, Input- output in
C++, Tokens, Keywords, Identifiers, Data Types C++, Derives data types. The void data
type, Type Modifiers, Typecasting, Constant
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
2. Paradigms of Programming Languages
A programming paradigm is a style or “way” of
programming. Some languages make it easy to write in
some paradigms but not others.
3. List of Common Paradigms
Imperative Programming:
Control flow in imperative programming is explicit: commands show how the computation takes place, step by
step. Each step affects the global state of the computation.
Structured Programming:
Structured programming is a kind of imperative programming where the control flow is defined by nested loops,
conditionals, and subroutines, rather than via gotos. Variables are generally local to blocks (have lexical scope).
Eg:- Algol 60, PL/I, Algol 68, Pascal, C, Ada 83, Modula, Modula-2.
Object Oriented Programming:
OOP is based on the sending of messages to objects. Objects respond to messages by performing operations.
Messages can have arguments, so "sending messages" looks a lot like calling subroutines.
Eg:- Simula-67; Smalltalk, C++, CLOS (object system of Common Lisp), Eiffel, Modula-3, Ada 95, Java, C#,
Ruby.
Declarative Programming:
Control flow in declarative programming is implicit: the programmer states only what the result should look like,
not how to obtain it. No loops, no assignments, etc.
Functional Programming:
In functional programming control flow is expressed by combining function calls, rather than by assigning
values to variables.
4. Logic and Constraint Programming:
Logic and constraint programming are two paradigms in which programs are built by setting up relations that
specify facts and inference rules, and asking whether or not something is true (i.e. specifying a goal.)
Unification and backtracking to find solutions (i.e. satisfy goals) takes place automatically.
Eg:- Prolog, GHC, Parlog, Vulcan, Polka, Mercury, Fnil.
Procedural Programming:
Procedural programming uses a list of instructions to tell the computer what to do step-by-step. A procedure
contains a series of computational steps to be carried out. Procedural programming is also referred to as
imperative programming. Procedural programming languages are also known as top-down languages.
Eg:- Fortran, COBOL and C
5. Introduction to Oops
Object oriented programming is an approach that provides a way of modularizing programs by creating
partitioned memory area for both data and functions that can be used as templates for creating copies of such
modules on demand.
OOP is a way of organizing programs and data. The languages such as Java, C++, small talk, Ada support
OOP features.
OOPS ties data more closely to the functions that operate on it and protects it from unintentional
modification by other functions. OOPS allows us to decompose a problem into a number of entities called
objects and then build data and methods around these entities. The combination of data and methods make up an
object.
Features of object-oriented paradigm:
1.Concentrate on data rather than
procedure.
2.Programs are divided into objects.
3.Data structures are designed to
characterize the objects.
5. Methods and data of an object are together in
the data structure
6. data is hidden and cannot be accessed by
external functions
7. Objects may communicates with each other
through methods
8. New data and methods can be easily added
using bottom-up approach
6. Basic concepts of Object-oriented programming
1.1.2.1 Classes:
A class is a collection of variables and methods that an object can have or it is a template or model for
building objects.
7. 1.1.2.2 Objects
An object is an instance of a class. The methods are the gateways to access data. The methods and data are
grouped together and placed in a container called object. The instances are the concrete representation of a class or
object. A class can have many instances.
8. 1.1.2.3 Data Abstraction
It refers to the act of representing essential features without including the background details.
For example to define a particular object we need not know all the things about that object. To define
student we can have data like Roll no, Name, marks etc. We need not have his color, weight etc. OOPs uses
data abstraction feature to put the abstract attributes and methods that operate on these attributes.
1.1.2.4 Data Encapsulation
The wrapping up of data and method into a single unit (called Class) is known as encapsulation. The data is not
accessible to the outside world and only those methods which are wrapped in the class, can access it. These methods
provide the interface between the objects data and the program. This insulation of the data from direct access by the
program is called data hiding.
9. 1.1.2.5 Inheritance :
It is the process by which objects of one class gets the properties of objects of another class.
The class whose property is being inherited by another class is called base class. The class that inherits a
particular property or a set of properties from the base class is called derived class.
The concept of inheritance provides the idea of reusability. This means we can add additional features to an
existing class without modifying it .This possible by deriving a new class from the existing one. The new class
will have the combined features of both the class. In java the derived class is known as subclass.
10. 1.1.2.6 Polymorphism:
It means the ability to take more than one form. The operation may exhibit different behavior in
different instances. The behavior depends upon the types of data used in operation.
For example, consider the operation of addition. For two numbers, the operation will generate a sum. If the
operands are strings, then the operation would produce a third string by concatenation.
1.1.2.7 Dynamic binding:
Binding refers to the linking of a procedure call to the code to be executed.
In response to the call, dynamic binding means that the code associated with a given procedure call is not known
until the time of the call that the run time. It is associated with polymorphism and inheritance. A procedure call
associated with a polymorphism reference depends on the dynamic types of that reference.
11. 1.1.2.8 Message communication:
An object oriented program consists of a set of object that communicate with each other.
Communication involves the following steps.
1. Creating classes.
2. Creating object from classes definition.
3. Establishing communication among objects.
Objects communicate with one another by sending and receiving information much the same way as people pass
messages to one another
A message for an object is a request for execution of a procedure and therefore will invoke a method
(procedure) in receiving object that generates the desired result. The message passing involves specifying, the
name of the object, the name of the method and the information to be sent.
12. Example:
Employee . salary (name)
Objects have a life cycle. They can be created and destroyed. Communication with an object is feasible as long as it
is alive.
13. 1.1.3 Benefits of OOPS
1. Repetition of codes is avoided by implementing inheritance.
2. Better quality of software.
3. security of data by the principle data hiding.
4. multiple objects can coexist without any interference.
5. objects in the problem domain can be mapped to those objects in the program.
6. it is easy to partition the work in the project.
7. Upgrading programs is easy.
8. complexity of the software is reduced.
9. Better communication between the objects.
1.1.4 Application of OOPS
1. Real-time systems
2. Simulation and modeling
3. Object oriented data bases
4. Hypertext, hyper media and expertext.
5. Artificial intelligence and expert systems.
6. Neural networks and parallel programming.
7. decision support and office automation systems.
8. CAD/CAM system.
14. 1.2.1 History of Java
Java is a general purpose; object oriented programming language developed by SUN micro Systems of USA.
sun micro Systems decided to develop special S/W that could be used to manipulate consumer
electronic devices like TVs, VCRs and toasters. A team of programmers headed by James
Gosling known as Green project team was formed to undertake the task. The team found that
oop’s like C and C++ had limitations in reliability and portability. So, they designed a new
language known as oak, which is simple, reliable and portable. The oak controlled the home
appliances using a hand held device with a touch sensitive screen.
the World Wide Web (www) appeared on the Internet. The green project team developed web
applets using oak, which can be run on all types of computers, connected to the Internet.
the team developed a web browser called Hot Java, which can be used to locate and run applet
programs on Internet. Thus, oak became popular.
, due to legal snags, oak was renamed as Java and companies like Netscape and Microsoft
supported it.
Java became the leader of Internet programming as well as a general purpose object oriented
language. Java is a platform-neutral language. It is the first programming language that is not
tied to any particular h/w or OS.
15. 1.2.2 Java features (Characteristics of Java)
1) Compiled and Interpreted:
Java is a two stage System. First the Java compiler translates the source code into byte code
instructions. This can be interpreted on any System that has a proper Java runtime on it. In the
second stage, the Java interpreter generates machine code that can be executed by the machine that is
running the Java program. Thus, Java is both a compiled and interpreted language.
2) Platform Independent and portable
Java is a platform independent language. Java programs can be easily ported from one computer
System to the other. Any change or upgradation in OS, processors and System resources will not
affect Java programs.
Java ensures portability in two ways. First, the Java compiler generates byte code instructions
which can be implemented on any machine. Second, the size of the primitive data types is
machine independent.
3) Object oriented
Java is a pure OOP language. Everything in Java is an object. All program code & data reside
within objects and classes. Java has an extensive set of classes, arranged in packages which can be
used in user programs by inheritance. The object model is simple and can be extended easily.
16. 1.2.2 Java features (Characteristics of Java)
4) Robust and Secure
Java is a robust language. It ensures reliable code. It checks code as we write it and again before
running it. Java is a garbage collected language. Hence, the programmers need not worry about
memory management problems. Java can handle exceptions and can catch even serious errors.
Thus, it eliminates the risk of crashing the System.
5) Distributed
Java is designed as a distributed language for creating applications on networks. It can share both
data & programs. Java applications can open and access remote objects on Internet easily as they
can do in a local System. Hence, multiple programmers at multiple remote locations can
collaborate and work together on a single project.
6) Simple, small and Familiar
Java is a small language. It is also simple to learn and write. Java doesn’t use concepts like
pointers, preprocessors, header files, go to statement. It also eliminates operator overloading and
multiple inheritance.
Java is a familiar language since the Java code looks like C++ code.
17. 1.2.2 Java features (Characteristics of Java)
7)Multithreaded and Interactive
Java supports multithreaded programs, which can handle multiple tasks simultaneously. For
example, we can listen to an audio clip while scrolling a page. Also at the same time, we can
download an applet from a distant computer.
Java runtime comes with tools that support multiprocess synchronization and thus we can easily
construct smoothly running interactive Systems.
8) High performance
Java speed is comparable to that of C++ Java architecture has been designed in such a way that
overheads are reduced during runtime. The multithreading feature helps to enhance the overall
executing speed of Java programs.
9) Dynamic and Extensible
Java is a dynamic language capable of linking new class libraries, methods and objects to it. We
can also determine the type of a class through a query. Depending upon the response, we can
either link it dynamically or abort the program.
Java functions support native methods which are nothing but programs written in languages like C
and C++. The native methods are linked dynamically at run time.
18. 1.2.3 Java environment
Java environment consists of the following
i) Java Development Kit (JDK)
ii) Application Programming interface called API (or)
Java Standard Library (JSL)
19. 1.2.3.1 jdk:
Java Development kit comes with a collection of tools that are used for developing and running Java programs.
1) appletViewer: It enables us to run Java applets.
2) java: It is an interpreter. It runs applets and applications by reading and interpreting byte code files.
3) Javac: It is the complier used to translate source code into byte code.
4) Javadoc: It creates the HTML format documentation from the Java source code files.
5) javah: It produces header files for use with native methods.
6) javap: It is the java disassembler that converts the byte code files into a program description.
7) jdb: It is the java debugger used to locate errors in a program.
1.2.3.2 API:
This contains no. of classes and methods for writing application programs. The commonly used packages are
1 ) Language Support package: A collection of classes and methods for implementing basic features
2) Utilities package: A collection of classes to provide utility functions such as date and time
3) Applet package: A collection of classes used to create applets.
4) Abstract window: A collection of classes used to implement GUI.
5) Input / Output package: A collection of classes used for input/ output manipulation.
20. 1.3 Introduction to Java
1.3.1 Types of Javaprograms
1.Stand alone applications
These are programs written to carry
out certain tasks on a stand alone local
computer. For executing such
programs, first the source code is
compiled into byte code using complier
and then the byte code is executed
using interpreter.
2.Web applets
These are small programs developed for Internet
applications. An applet located on a distant
computer (server) can be downloaded through
Internet and executed on a local computer (client)
using a Java compatible browser. Applets can be
developed for simple animated graphics to complex
games and utilities. Creating and running applets
are more complex since they are embedded in a
HTML document and run inside a web page.
21. 1.3.2 Creating & executing a Java program
Application programs are created and executed as follows.
A source code file is created using a text editor
It is then compiled using the compiler javac to produce byte code
and executed using interpreter java.
The debugger jdb finds errors in source code. javap is a disassembler
used to convert the byte code back into source code.
22. Character set
graphic <= alphanumeric | special
alphanumeric <= alphabetic | numeric
alphabetic <= lower-case | upper-case
lower-case <=a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
upper-case <=A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z
numeric <=0|1|2|3|4|5|6|7|8|9
special <= !|%|^|&|*|(|)|-|+|=|{|}|||~|[|]||;|'|:|"|<|>|?|,|.|/|#|@|`|_
1.3.3 Java tokens:
The smallest units of Java language are the characters used to write Java tokens. These characters are defined
by the Unicode character set. Java language includes five types of tokens and they are:
Reserved Keywords
Identifiers
Literals
Operators
Separators
23. 1.3.3.1 Key words
Reserved keywords are special identifiers that form part of a language definition. They are used to
identify built-in-types, modifiers and mechanisms for flow control. The keywords combined with operators
and separators according to a syntax form definition of the Java language. The keywords cannot be used as
names for variables, classes, methods and so on. There are 60 reserved words available. They should be
written only in lower case letters. They are
abstract boolean break byte byValue case
cast catch char class const continue
default do double else extends false
final finally float for future generic
goto if implements import inner instanceOf
int interface long native new null
operator outer package private protected public
rest return short static super switch
synchronized this threadSafe throw throws transient
true try var void volatile while
24. 1.3.3.2 Identifiers
Identifiers are used by programmers to name things in Java: things such as variables, methods, fields, classes,
interfaces, exceptions, packages, etc.
All identifiers must start with either a letter( a to z or A to Z ) or currency character($) or an underscore.
After the first character, an identifier can have any combination of characters.
A Java keyword cannot be used as an identifier.
Identifiers in Java are case sensitive, foo and Foo are two different identifiers.
1.3.3.3 Literals
All constant values written in a program are literals.
Types of literals
Integer literal
floating-point literal
Boolean literal
Character literal
String literal
Null literal
Literal Type
1 Int
3.14 double (1. is a double too)
True boolean
'3' char ('P' and '+' are char too)
"CMU ID" String
Null any reference type
Here are some examples of literals of each of
these types.
25. 1.3.3.4 Separators (also known as a punctuators)
There are nine, single character separators in Java
; , . ( ) { } [ ]
1.3.4 Java virtual machine(JVM):
All language compilers translate source code into machine code for a specific computer. But java compiler produces
an intermediate code known as byte code for a machine that does not exist. This machine is called the java virtual
machine and it exists only inside the computer memory. The process of compiling a java program into byte code
which is also referred to as virtual machine code. The virtual machine code is not machine specific. The machine
specific code known as machine code is called generated by the java interpreter.
26. 1.3.5 Command line arguments:
Sometimes, we may like our programs to act in a particular way depending on the i/p given at the time of
execution. This is achieved using command line arguments. Command line arguments are parameters that are
supplied to the program at the time of invoking it for execution.
Eg;-
class Comlinetest
{
public static void main (String args [])
{
int count, i=0;
String s;
count =args.length;
System.out.println (“No. of arguments =”+count);
while (i<count)
{
s=args [i];
i=i+1;
System.out.println (i+”:”+”java is”+s);
}}}
Compile using
javac comlinetest.java
Run using
java comlinetest simple object_oriented distributed robust secure
o/p
No. of arguments =5
1. java is simple
2. java is object oriented
3. java is distributed
4. java is robust
java is secure
27. The command line arguments are passed to the program through the array args. The
command line has 5 arguments. They are assigned to the array args as follows
args[0] =”simple”
args[1] = “object. oriented”
args[2] = “distributed”
args[3] = “robust”
args[4] = “secure”
o/p
No. of arguments =5
1. java is simple
2. java is object oriented
3. java is distributed
4. java is robust
5. java is secure1.3.6 Comments in Java Program:
The comment lines give the name of the program, author and other details like why and what of classes and
how of algorithms. Comments help to maintain the program.
1. Single line comment
The comment is written beginning with
Eg: - sample program
2. Multiline comment
This comment is written beginning with /* and ending with */
Eg: - /* sample program
Written on 25-5-04*/
3. Documentation comment
It is used for generating documentation automatically beginning with /** and ending with * /