WEB7.0(OJ7) Tutorial
=====================================================================
Unit-1 : Introduction to WEB7.0(OJ7) Programming Language
=======================================================================
Definition:
“WEB7.0(OJ7) is meant for Code Security, Learnable,Console software, it is Advanced , used in Software development, Remote X Application,web application ,machine Learning,etc, and it symbolizes Star symbol, used with WEB7.0(OJ7) framework like scroll framework ”
ABOUT WEB7.0(OJ7)
WEB7.0(OJ7) Programming Language is invented by wilmix jemin j at year 2013
in java ,DOTWEB3.0. This two versions of JAVA (Jdk1.8,jdk1.7) failed that is using JAD decompiler
we can easily take the source code..
We felt thanks to best friends venkat friend , github , and all for their support..
DEMERITS of JAVA and C#
a) JAVA class file has many demerits so any thing you create a compiler in java the source code can be easily taken by JAD.
That's why WEB7.0(OJ7) is focused. So Creating software in JAVA is useless.
WEB7.0(OJ7) is used for creating datastructures and compilers. WEB7.0(OJ7) accepts ".java7" filename and translate to WEB7.0(OJ7) class file.
that java is said to WEB7.0(OJ7) different from orginal java; which is not understood by hackers.
WEB7.0(OJ7) is not focused for GUI side eg) Java Swing.
Is it possible to create a compiler like Java compiler?
By using Java compiler we can create a Java compiler or What ever compiler you want. But when you create a Java like compiler from Java some competitors or unauthorized hackers who visit the webpage say it is wrong. But according to principles of Compiler design
it is right. Because you are designing the compiler and writing java source code to design a java like compiler. The same thing we can create for C programming language ,etc. Iam not focused on Creating like Java Swing or Like Java/j2ee. Because this hacker or unwanted person or competitors will say lies about me. So it will affect my products.
My Compiler design history
At age 21 ,i design a compiler in Vc++.And Later i designed a mini compiler in java.
Why WEB7.0(OJ7) is Advanced than any programming language ?
i) Both WEB7.0(OJ7) and java/j2ee is like english fluent language.
ii) Using WEB7.0(OJ7) we can reduce the lines of code.
iii) WEB7.0(OJ7) and Java/j2ee follow camel case and can be adjusted at any style with beautiful arrangement using Intellij IDE .
iv) WEB7.0(OJ7) author is not interested in Robot design (AI) field. Because AI is
belong to antichrist technology.
v) WEB7.0(OJ7) module Oakjava8 is best in Mobile computing.
===============================================================================
WEB7.0(OJ7) Programming Modules is divide into 2 modules Which are
WEB7.0(OJ7) - Module -1 And WEB7.0(OJ7) Module -2.
About WEB7.0(OJ7) Modules
WEB7.0(OJ7) keywords are created simillar to its parent java , so that it is easy for the java professionals and companies to follow or learn it. Only there is some major syntax have attractive syntax. But WEB7.0(OJ7) is used in console application,Web application, Machine learning application, Datascience, and Remote X application. Here in this WEB7.0(OJ7) modules Module-1 is followed by Java or WEB7.0(OJ7) Professionals.We will release Remote -X Application later after machine Learning and data science are completely released.
WEB7.0(OJ7) Reserved Keywords -MODULE1
WEB7.0(OJ7) has a set of keywords that are reserved words that cannot be used as variables, methods, classes, or any other identifiers.
Keyword and Description
<JAVA7>
This <JAVA7> is the keyword indicates the starting point of the
WEB7.0(OJ7) program. And it is the attractive syntax. When we use
this Keyword it will handle input and output operations.
</JAVA7>
This </JAVA7> is the keyword indicates the ending point of the
WEB7.0(OJ7) program. And it is the attractive syntax. When we use
this Keyword it will tell the compiler to end that program.
abstract
A non-access modifier. Used for classes and methods: An abstract class cannot be used to create objects
(to access it, it must be inherited from another class). An abstract method can only be used in an
abstract class, and it does not have a body. The body is provided by the subclass (inherited from)
assert
For debugging and checking conditions
boolean
A data type that can only store true or false values
break
Breaks out of a loop or a switch block
byte
A data type that can store whole numbers from -128 and 127
case
Marks a block of code in switch statements
<CATCH>
Catch all the exceptions generated by try statements
char
A data type that is used to store a single character
<CLASS>
Defines a class
continue
Continues to the next iteration of a loop
default
Specifies the default block of code in a switch statement
do
Used together with while to create a do-while loop
double
A data type that can store fractional numbers from 1.7e−308 to 1.7e+308
else
Used in conditional statements
enum
Declares an enumerated (unchangeable) type
<---
Extends a class (indicates that a class is inherited from another class)
final
A non-access modifier used for classes, attributes and methods, which makes them non-changeable (impossible to inherit or override)
<FINALLY>
Used with exceptions, a block of code that will be executed no matter if there is an exception or not
float
A data type that can store fractional numbers from 3.4e−038 to 3.4e+038
for
Create a for loop for single looping and double or .. looping purpose
if
Makes a conditional statement
-->
Implements an interface
<IMPORT>
Used to import a package, class or interface
instanceof
Checks whether an object is an instance of a specific class or an interface
int
A data type that can store whole numbers from -2147483648 to 2147483647
interface
Used to declare a special type of class that only contains abstract methods
long
A data type that can store whole numbers from -9223372036854775808 to 9223372036854775808
native
Specifies that a method is not implemented in the same Java source file (but in another language)
new
Creates new objects
<PACKAGE>
Declares a package
private
An access modifier used for attributes, methods and constructors, making them only accessible within the declared class
protected
An access modifier used for attributes, methods and constructors, making them accessible in the same package and subclasses
public
An access modifier used for classes, attributes, methods and constructors, making them accessible by any other class
return
Finished the execution of a method, and can be used to return a value from a method
short
A data type that can store whole numbers from -32768 to 32767
<SHARED>
A non-access modifier used for methods and attributes. Static methods/attributes can be accessed without creating an object of a class
<SUPER>
Refers to superclass (parent) objects
switch
Selects one of many code blocks to be executed
synchronized
A non-access modifier, which specifies that methods can only be accessed by one thread at a time
<IS>
Refers to the current object in a method or constructor
throw
Creates a custom error
throws
Indicates what exceptions may be thrown by a method
transient
Used to ignore an attribute when serializing an object. transient state
is not saved.
<TRY>
Creates a try...catch statement. All try key words should include
catch block...
void
Specifies that a method should not have a return value
volatile
Indicates that an attribute is not cached thread-locally, and is always read from the "main memory". Here multiple thread can access it there will be no traffic.
while
Creates a while loop. If the condition is true while loop will process
the statements inside the block other wise it will exit out of the loop.
==============================================================
Note: Now look at this given below sample program how this keyword for WEB7.0(OJ7) is used....
testme.java7
<JAVA7>
public <CLASS> testme
//--> Runnable
<--- <Thread>
<%
public <SHARED> int sum()
{
int b;
return(2+3);
}
public synchronized void <RUN>
{
<TRY>
{
<PRINTLINE>(" Under Weight is less than 15 your health is worst ="+sum());
<Thread>.sleep(1000);
throw new Exception();
}
<CATCH> (Exception e)
{
<PRINTLINE>(""+e);
}
}
<MAIN>
<%
<TRY>
{
testme t <NEW> testme();
t.start();
testme t1 <NEW> testme();
t1.start();
int value = 15;
if (value >=15)
{
assert value >= 25 : " Underweight";
<PRINTLINE>(" value is " + value);
}
else
{
<PRINTLINE>(" Under Weight is less than 15");
}
}
<CATCH> (Exception e)
{
<PRINTLINE>(""+e);
}
<FINALLY>
{
<PRINTLINE>(" note: please enter accurately");
}
%>
</JAVA7>
Output
value is 15 Under Weight is less than 15 your health is worst =5
Under Weight is less than 15 your health is worst =5
note: please enter accuratelyjava.lang.Exceptionjava.lang.Exception
===============================================================================
WEB7.0(OJ7) Reserved Keywords -MODULE-2
WEB7.0(OJ7) has a set of keywords that are reserved words that cannot be used as variables, methods,
classes, or any other identifiers. In this MODULE-2 we will develop a Prototype software like .exe file. Such software is used for console based WEB7.0(OJ7) program. It is designed in such a way WEB7.0(OJ7),Java/j2ee professionals can follow it.
Keyword and Description
There are total 50 keywords in WEB7.0(OJ7) as follows:
<ABSTRACT>
-> Abstract class can be created using <ABSTRACT> keyword.
<BREAK> -> Break out of loop
<CASE> -> Case keyword is used as option with Switch statement.
<CATCH> => It is used to catch Exceptions.
<CLASS> -> Class is the collection of objects
<CONTINUE> -> Continue with in a loop
<DO> --- <WHILE> -> <DO> keyword is used with While loop. While will continue executes statements in the block
until the condition in while is true.
<ELSE> -> <ELSE> key word is followed after <IF> statement
<ENUM> =>
An enum is a special "class" that represents a group of constants (unchangeable/read-only variables).
<FINALLY> => The Keyword <FINALLY> is used in finally block. It did not mind whether there is catch block present or not. It will always execute...
<FOR> => This keyword is used for Forloop.
<FOREACH> =>
The foreach loop is used to iterate over the elements of the collection.
The collection may be an array or a list or set.
It executes for each element present in the array.
<GOTO> goto => <GOTO> keyword is used with labels.
<IF> => <IF> keyword is for condition purpose
is => The is keyword operator is used to check if the run-time type of an object is compatible with the given type or not.
It returns true if the given object is of the same type otherwise, return false. It also returns false for null objects.
<IN> => It is used for the given element is present or not.
<OBJECT> => object are the instance of the class that
are created to use the attributes and methods of a class.
<INTERFACE> => Interface is used multiple inheritance
<DEFAULT> => Default Keyword is used with the switch statement.
<BASE> => base keyword, we can call the base class method also. It is useful if base and derived classes defines same method.
In other words, if method is overridden.
<LOCK> =>
Lock keyword ensures that one thread is executing a piece of code at one time. The lock keyword ensures that one thread does not enter a critical section of code while another thread is in that critical section.
<PACK> => <PACK> keyword means PACKAGE in WEB7.0(OJ7).
A package is a namespace that organizes a set of related classes and interfaces.
<NEW> => It is used to create a object of the class.
<OPERATOR> => It is used for Operator loading.
<READONLY> =>
The readonly keyword can be used to define a variable or an object as readable only.
This means that the variable or object can be assigned a value at the class scope
or in a constructor only. You cannot change the value or reassign a value to a readonly variable
or object in any other method except the constructor.
<RET> -> Return the Value of any type
<SIZEOF> => The sizeof operator returns the number of bytes occupied by a variable of a given type.
<TYPEOF> => It is used to get a Type object representing String.
void => Void type means we can call the method in the main program section.It have no return type.
Shared => If a class is static and it contains any userdefined methods. That can be called in main class
without creating a Object. eg) student is the static class which contains display method.Then
how it can be called , that can be achieved using student.display().
<STR> => <STR> keyowrd is String in WEB7.0(OJ7)
<STRUCT> => This keyword represents structure of records.
<SWITCH> => switch keyword is used to select one of many code blocks to be executed.
<IS> => <IS> keyword represent this
<TRY> => This represent try block
<THROW> => This is used to throw the exception
<USE> => This is used to call any WEB7.0(OJ7) libraries or WEB7.0(OJ7) packages and we can reuse it.
<VIRTUAL> =>
virtual method is a method that can be overridden in a derived class. When a method is declared as
virtual in a base class, it allows a derived class to provide its own implementation of the method.
<VOLATILE> => This keyword represent synchronization happen at variable. All threads can access the
Volatile variable.
<WHILE> => This keyword represent while loop
<JAVA7> => This keyword is used to load io packages.Which will b used with Java/J2ee professionals.
<JAVA> => This keyword is used to load io packages, used to create a prototype console and web application ,etc.
<HEAPJ7> => HeapJ7 keyword respresent we can store any objects contains millions of data by using the J7heap. It is used to avoid Memmory overflow...
<CONVERTARRAYLIST> ,J7mem.ConverttoArrayList => This ConverttoArrayList method is used to convert string to arraylist.
<OVERRIDE> => This keyword is used to override the method of parent class.
bool => This keyword will be used to hold the true or false value.The bool indicates boolean in WEB7.0(OJ7). eg) bool a =true; bool b=false;
get and set => get keyword is used for retrieving data. And set is used for setting value.
<OAKJAVA7SECURITY> => This is use to maintain security for WEB7.0(OJ7) executable file.
So WEB7.0(OJ7) Module-1 and WEB7.0(OJ7) Module-2 are called as Diamond module. Which means it support .java7 programs.
Example) When .java7 programs are compiled using webc7 <filename>.java7
it will create .jclass and .exe files. So WEBC7 complier is opensource for the WEB7.0(OJ7) professionals to practice it.
There is the 3rd WEB7.0(OJ7) module
which will be related to security.That you can learn in WEB7.0(OJ7) Enterprise Edition.
Let us see the example for Operator Overloading
and WEB7.0(OJ7) Structure.
============================================================================
WEB7.0(OJ7) Structure
============================================================================
What is WEB7.0(OJ7) Structure ?
Structure is a value type data type. It helps you to make a single variable hold related data of various data types.
Syntax:
AccessModifier <STRUCT> structure_name
{
<- Structure block contains Fields,Parameterized constructor ,Constants,Properties,various data types,
Methods -->
}
Example:-
Write a WEB7.0(OJ7) program to create a Structure name Person with fields Name,Age,Weight
Assign the data for Name,Age,Weight. Copy the structure data(Name,Age,Weight) from one Structure to another Structure.
j7samplestructure.java7
<JAVA>
// WEB7.0(OJ7) program to illustrate copy the structure
<PACK> StructApplication {
// Defining structure
public <STRUCT> Person
{
// Declaring different data types
public string Name;
public int Age;
public int Weight;
}
<CLASS> JITs {
// Main Method
public void main()
{
// Declare P1 of type Person
Person P1;
// P1's data
P1.Name = "Wilmix Jemin";
P1.Age = 21;
P1.Weight = 58;
// Declare P2 of type Person
Person P2;
// Copying the values of P1 into P2
P2 = P1;
// Displaying the values of P1
<PRINTLN>("Values Stored in P1");
<PRINTLN>("Name: " +P1.Name);
<PRINTLN>("Age: " +P1.Age);
<PRINTLN>("Weight: " +P1.Weight);
<PRINTLN>("");
// Displaying the values of P2
<PRINTLN>("Values Stored in P2");
<PRINTLN>("Name: " +P2.Name);
<PRINTLN>("Age: " +P2.Age);
<PRINTLN>("Weight: " +P2.Weight);
}
}
}
Output
Values Stored in P1
Name: Wilmix Jemin
Age: 21
Weight: 58
Values Stored in P2
Name: Wilmix Jemin
Age: 21
Weight: 58
============================================================
Operator Overloading in WEB7.0(OJ7)
=============================================================
What is Operator Overloading in WEB7.0(OJ7)?
It is a special function called operator function is used for overloading purpose.
These special function or method must be public and static.
Syntax for operator function is given below..
public static return-type operator op (argument list)
Where the op is the operator to be overloaded and operator is the required keyword.
For overloading the unary operators, there is only one argument and for overloading a binary operator there are two arguments.
Example:-
Write a WEB7.0(OJ7) program to perform operator overloading
for the given two nos. And perform addition,substraction,multiplication, and
division.
calc.java7
<JAVA>
<PACK> calcpackage {
<CLASS> Calculator {
public int number = 0;
// no-argument constructor
public Calculator() {}
// parameterized constructor
public Calculator(int n)
{
number = n;
}
// Overloading of Binary "+" operator
public Shared Calculator <OPERATOR>+ (Calculator Calc1,Calculator Calc2)
{
Calculator Calc3 <NEW> Calculator(0);
Calc3.number = Calc2.number + Calc1.number;
return Calc3;
}
// Overloading of Binary "-" operator
public Shared Calculator <OPERATOR>- (Calculator Calc1,Calculator Calc2)
{
Calculator Calc3 <NEW> Calculator(0);
Calc3.number = Calc2.number - Calc1.number;
return Calc3;
}
// Overloading of Binary "*" operator
public Shared Calculator <OPERATOR>* (Calculator Calc1,Calculator Calc2)
{
Calculator Calc3 <NEW> Calculator(0);
Calc3.number = Calc2.number * Calc1.number;
return Calc3;
}
// Overloading of Binary "/" operator
public Shared Calculator <OPERATOR>/ (Calculator Calc1,Calculator Calc2)
{
Calculator Calc3 <NEW> Calculator(0);
Calc3.number = Calc1.number / Calc2.number;
return Calc3;
}
// function to display result
public void Print()
{
<PRINTLN>("{0}", number);
}
}
<CLASS> CalNum {
// Driver Code
public void main()
{
Calculator num1 <NEW> Calculator(500);
Calculator num2 <NEW> Calculator(80);
Calculator num3 <NEW> Calculator();
<PRINTLN>("------------------------------------");
num3 = num1 + num2;
num1.Print(); // Displays 500
num2.Print(); // Displays 80
num3.Print(); // Displays 580
<PRINTLN>("------------------------------------");
num3 = num1 - num2;
num3.Print();
<PRINTLN>("------------------------------------");
num3 = num1 * num2;
num3.Print();
<PRINTLN>("------------------------------------");
num3 = num1 / num2;
num3.Print();
}
}
}
Output
------------------------------------
500
80
580
------------------------------------
-420
------------------------------------
40000
------------------------------------
6
=====================================================================
WEB7.0(OJ7) Error Document
=====================================================================
WEB7.0(OJ7) Error Document for Module -1
This Module -1 is very simple when ever error comes
it will print all the errors in out.txt in the directory
where oakjava7 files reside. So no need to study about that.
Just practice it you will learn it easily.
WEB7.0(OJ7) Error Document for Module -2
This WEB7.0(OJ7) Error Document contains every meaning for Error code. Example when you compile the program
using Webc7 <filename>.java7 or. web extension, when you include the code like int c=100/0; it will generate a error
so in case of the error message box will be displayed. It will
mention the lineno and Errorcode as J70020 -> Division by constant zero. Simillarly this type of Error model is present for all.
A) Steps for running WEB7.0(OJ7) in Jshell instead of command prompt
Steps for running WEB7.0(OJ7) in Jshell instead of command prompt are given below...
i) Click the Jshell.bat file in your folder ; in my case
i store all the .java7 file in wilmix7 directory.
or create .bat file containing Java7Shell.exe including c:/webc7/src directory.
go to your directory that is in my case i will goto c:/wilmix7 directory.
ii) After that goto JShell and to compile the .java7 files WEB7.0(OJ7) also compile and run the .java7 files
and produces the .class and .jclass files.Which can be used for scroll webpages(webapplications).Better you
compile .java7 files in Visualstudio command prompt.
B) Given below is about the error codes with their Explanation ...
J71518 => <CLASS> syntax or keyword <CLASS> is not found or some characters or ugly character found or Invalid identifier found
used in <PACK> name or <CLASS> name or variable name.
J70246 => Wrong namespace name or Compilation error or special characters like ! or #,etc are found or <PRINTLN> keyword is not correct
or HTML.displayhtml is not correct , Some characters or numeric or lengthy numeric found inside the keywords of WEB7.0(OJ7) which is
present inside the WEB7.0(OJ7) main method or unknown variable assigned to a string
J71022 => Due to careless or additional curly braces like } or { which is present inside the WEB7.0(OJ7) main method or type or namespace definition or end of file expected
J71056 => Unexpected special character found inside the main method or in <PACK> name
J71646 => String expected after verbatim specifier :@
J71519 => Invalid token ! or # in class,struct or interface member declaration or invalid identifier found.
J71585 => Invalid Special character _ is found inside the class.
J71589 => Invalid token + in class,struct or interface member declaration.
J71001 => Identifier contains special character or numeric preceded before characters or class syntax expected
J71041 => Identifier expected namespace is a keyword or missing package name after <USE> keyword",
J70003 => Out of Memory Error
J70015 => Required file ,file could not be found or The name of type type or identifier name is too long.
J70019 => Operator operator cannot be applied to operands of type type and type
J70020 => Division by constant zero
J71002 => Invalid Special Character _ or - or # or ! or + found,etc, Please remove it or Special character = not included for class instanation or <PRINTLN> not defined properly or invalid identifier found or used as a class object name.
J70103 => Special character should not be allowed at WEB7.0(OJ7) main method or invalid class object or invalid variable for the class
J71514 => Special character # or ! or _ or + ,etc is found at <PACK> identifier should be removed.
=======================================================================
Note: The hackers (unauthorized person) may copy WEB7.0(OJ7) features and implement it.
That's why we kept WEB7.0(OJ7) features as secret.
=========================================================================
Unit-2: Program Structures for WEB7.0(OJ7)
=========================================================================
SYNTAX-1:
=========
Filename.java7
public class <classname>
{
//This constructor with super method is mandatory, which indicates it is a web7.0(OJ7) //program
// This constructor should have same name as the classname .
public <classname>()
{
super();
}
// it means it will not support any java compiler, it is entirely different.
public void main()
{
<! WEB7.0(OJ7) Logic !>
}
}
Example:
Query3.java7
class Query3
{
public Query3()
{
super();
}
// Method declared for this WEB7.0(OJ7) program to print
//the text Welcome! to EveryBody
public void displayhtmltoweb(String a)
{
//print is to print the text or html GUIS
print("\n\n");
print("<HTML><script> </script><body bgcolor=green> Welcome!</body></html>"++a);
print("\n\n");
}
// All the WEB7.0(OJ7) main method should have public void main() instead of
//public static void main method of java language.
public void main()
{
// call the displayhtmltoweb
displayhtmltoweb(" to EveryBody");
}
}
Note: This is simillar to Java Servlet , This topic is mentioned only at Enterprise edition.
And this program generated class file is sealed as
"An WEB7.0(OJ7)(JAVA7.0) compiler - jemin Information technology - JIT-777-WRIT-0003 Query3.class" .
So this is another type of WEB7.0(OJ7) program and it is called as WEB7.0(OJ7) Servlet.
SYNTAX-2
filename.java7
<JAVA>
<USE> packages;
<PACK> packagename
{
<CLASS> <classname>
{
public void main()
{
<! source code !>
}
}
}
SYNTAX-3
Filename.java7
<JAVA7>
<Access modifiers> <CLASS> <classname>
{
<MAIN> // it means it cannot be run in jdk1.8 compiler
<%
<! OAKJAVA7 Logic !>
%>
</JAVA7>
JAVA7.0 SYNTAX-1 Program Structure(.java7)
Declaration WEB7.0(OJ7) Section :
public class <classname>
{
//This constructor with super method is mandatory, which indicates it is a WEB7.0(OJ7)
//program and class name and constructor name should be same
public <classname>()
{
super();
}
Documentation Section
// it means it will not support any java compiler, it is entirely different.
Package Statement;
Import Statement;
WEB7.0(OJ7) LOGIC SECTION
// WEB7.0(OJ7) main method should have public void main method otherwise WEB7.0(OJ7)
program will not compile....
public void main()
{
<! WEB7.0(OJ7) Logic !>
}
CLOSE WEB7.0(OJ7) LOGIC SECTION }
LOGIC WEB7.0(OJ7) DATASTRUCTURE SECTION
class <CLASSNAME>
{
private <CLASSNAME>()
{
super();
}
................
................
................
CLOSE LOGIC WEB7.0(OJ7) DATASTRUCTURE SECTION }
ENDING SECTION :
Explanation:
All WEB7.0(OJ7) should start WEB7.0(OJ7) declaration section as
public class <classname>
{
//This constructor with super method is mandatory, which indicates it is a WEB7.0(OJ7) program.
The class name and constructor of WEB7.0(OJ7) program should be same.
public <classname>()
{
super();
}
after that WEB7.0(OJ7) LOGIC SECTION should be
public void main()
{
<! WEB7.0(OJ7) Logic !>
}
so <!WEB7.0(OJ7) Logic> may have print statements, for loop,
Datastructure statements belong to another class.
But Logic WEB7.0(OJ7) DataStructure Section should be in this format
class <CLASSNAME>
{
private <CLASSNAME>()
{
super();
}
and Close Logic WEB7.0(OJ7) DataStructure section by using curly braces which is "}".
I hope this syntax change will be easy to follow and to do programming
in WEB7.0(OJ7). I remove the complexity of the WEB7.0(OJ7) program syntax. So now
this type of WEB7.0(OJ7) servlet syntax is learnable.
=================================
WEB7.0(OJ7) SYNTAX-2 Program Structure
filename.java7
Beginning Section : <JAVA>
Documentation Section
Package Statement;
<USE> Statement;
<PACK> packagename
LOGIC SECTION
<CLASS> <classname>
{
public void main()
{
<! source code !>
}
CLOSE LOGIC SECTION
ENDING SECTION : }
Explanation:
WEB7.0(OJ7) Ending section is } ; Ending your WEB7.0(OJ7) program
Documentation Section means you can include description
with comments.
Package statement means you had to include WEB7.0(OJ7) program in Package ....
<USE> statement to import all the packages.
Interface statement for supporting multiple inheritance.
Logic section for writing WEB7.0(OJ7) logic with Class followed by main method .
after writing logic close the logic section.
WEB7.0(OJ7) SYNTAX-3 Program Structure(.java7)
Beginning Section : <JAVA7>
Documentation Section
Package Statement;
Import Statement;
LOGIC SECTION
<Access modifiers> <CLASS> <classname>
{
<MAIN>
{
<! source code !>
}
CLOSE LOGIC SECTION
ENDING SECTION : </JAVA7>
Explanation
All WEB7.0(OJ7) should start with <JAVA7> then after that followed by <CLASS> <classname>
But <MAIN> is used instead for
public static void main(String args[]) for protection from hackers.
Logic section for writing WEB7.0(OJ7) logic with Class followed by main method .
after writing logic close the logic section.
A) Print numbers between 0 to 99 using WEB7.0(OJ7) -major syntax:-
display2.java7
<JAVA7>
public <CLASS> display2
{
<MAIN>
<%
for (int i=0;i<100;i++)
{
<PRINTLINE>(""+i);
}
%>
</JAVA7>
Output:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
b) How to draw Bernoulli Distribution using WEB7.0(OJ7)-major syntax ie filename.java7 ?
Bernoulli.java7
<JAVA>
<USE> Java7MLGraphics;
<PACK> Bernoulli1
{
<CLASS> binomialdist
{
public void main()
{
Bernoulli.Draw(32, 1000, 0, 0.2);
Console.ReadKey();
}
}
}
Note: This can be done in just one line
ie) Bernoulli.Draw(32, 1000, 0, 0.2)
Syntax For Bernoulli Distribution is
Bernoulli.Draw(int n, int trials,int coord1,double coord2)
Note: You can to include Java7MLGraphics.dll,IKVM.OpenJDK.SwingAWT.dll
in WEB7.0(OJ7) properties file..
c) Write a WEB7.0(OJ7)-major program using Java7 Colections with a Box example:-
Programs1.java7
<JAVA>
<USE> <WEB7>.IO; //<WEB7>-io packages
<USE> CUTIL; //Web7 cutil packages
<PACK> BoxApplication
{
<CLASS> Box
{
private double length; // Length of a box
private double breadth; // Breadth of a box
private double height; // Height of a box
public void setLength( double len )
<%
length = len;
}
public void setBreadth( double bre )
<%
breadth = bre;
}
public void setHeight( double hei )
<%
height = hei;
}
public double getVolume()
<%
return length * breadth * height;
}
}
<CLASS> Boxtester
{
public void main()
{
Box Box1 <NEW> Box(); // Declare Box1 of type Box
Box Box2 <NEW> Box();
double volume;
// Declare Box2 of type Box
// box 1 specification
Box1.setLength(6.0);
Box1.setBreadth(7.0);
Box1.setHeight(5.0);
// box 2 specification
Box2.setLength(12.0);
Box2.setBreadth(13.0);
Box2.setHeight(10.0);
// volume of box 1
volume = Box1.getVolume();
<PRINTLN>("Volume of Box1 :" +volume);
// volume of box 2
volume = Box2.getVolume();
// <PRINTLN>("Volume of Box2 : {0}", volume);
// Console.ReadKey();
CUTIL.ArrayList x <NEW> CUTIL.ArrayList();
// test size
<PRINTLN>("Initial size is " + x.size());
// test isEmpty
if (x.isEmpty())
<PRINTLN>("The list is empty");
else <PRINTLN>("The list is not empty");
// test put into ArrayList
x.add(0, Java7Collection.QUERY()); // get previous data from java7collection and put it into java7-arraylist at 0 location.
x.add(1, (6));
x.add(0, (1));
x.add(2, (4));
<PRINTLN>("List size is " + x.size());
// test toString
<PRINTLN>("The list is " + x);
String JAVA5 = "Java 5";
String JAVA6 = "Java 6";
String JAVA7 = "Java 7";
int c=1;
switch (c) {
case 1:
<PRINTLN>(JAVA5);
break;
case 2:
<PRINTLN>(JAVA6);
break;
case 3:
<PRINTLN>(JAVA7);
break;
}
<TRY>
{
Java7Collection.InsertQUERY(x.ToString());// insert arraylist at java7 collection memory
Java7Collection.QUERY(x.ToString(),"display23");// merge the output display23.java7.exe output with arraylist
}
<CATCH> (<EXE> e) {}
// test indexOf
int index = x.indexOf((4));
if (index < 0)
<PRINTLN>("4 not found");
else <PRINTLN>("The index of 4 is " + index);
index = x.indexOf((3));
if (index < 0)
<PRINTLN>("3 not found");
else <PRINTLN>("The index of 3 is " + index);
// test get
<PRINTLN>("Element at 0 is " + x.get(0));
<PRINTLN>("Element at 3 is " + x.get(3));
// test remove
<PRINTLN>(x.remove(1) + " removed"); //arraylist data removed
<PRINTLN>("The list is " + x);
<PRINTLN>(x.remove(2) + " removed");// 6 is removed
<PRINTLN>("The list is " + x);
if (x.isEmpty())
<PRINTLN>("The list is empty");
else <PRINTLN>("The list is not empty");
<PRINTLN>("List size is " + x.size());
}
}
}
The given output indicates that it is merging two WEB7.0(OJ7) output by using Java7collection.
Output:
Volume of Box1 :210
Initial size is 0
The list is empty
List size is 4
The list is [1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [2000], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]
Java 5
HELLO WORLD! MY First WEB7.0(OJ7) Program-display-program-1
The index of 4 is 2
3 not found
Element at 0 is 1
Element at 3 is 6
[[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [[1, [2000], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]], 4, 6]] removed
The list is [1, 4, 6]
6 removed
The list is [1, 4]
The list is not empty
List size is 2
=================================================================================================
UNIT-3 : WEB7.0(OJ7) Advanced Concepts (WEB7.0(OJ7) util packages)
=================================================================================================
WEB7.0(OJ7) Advanced Concepts
This is about WEB7.0(OJ7) Advanced Concepts invented by Wilmix Jemin j belong to WEB7.0(OJ7) Programming Language
which will be used with WEB7.0(OJ7) Programming Language. Its file extension is .web7.
BUCKET
Bucket are used to store key,value data, and Generated Random number
where datatype may be string ,object ,etc.
SYNTAX:
Bucket<DATATYPE> list = <NEW> Bucket<DATATYPE>(<DATATYPEVALUE>);
list.KeyAdd(<DATATYPEVALUE>);
list.add(<DATATYPEVALUE>);
list.RandomAdd();
list.Display(list);
Advantages
Using Bucket you can also Retrieve the values stored n position.
Searching and Insertion is fast than other DTS.
Random Indexing is possible.
eg) If you store a duplicate value such Random key will be different.
It also used to add many values.
EXTEND
Extend class is used in ,<WEB7> since to provide multiple inheritence
about 100000000 classes . Extends class also list values in methods and
constructor values.
Extend means a Bucket contains List of class and it is also
Behave like Bucket. So it is also one of the Advanced concepts in JDollarShell.
SYNTAX:
EXTEND <<DATATYPE>> list11 = <NEW> EXTEND <<DATATYPE>> (STRING);
list.KeyAdd(<DATATYPEVALUE>);
list.add(<DATATYPEVALUE>);
list.RandomAdd();
list.Display(list);
Advantages:
It is also used to add many values
Indexing is possible
Value can also be list by index and behave like bucket.
It list only the class value and object value.
It is stateless.
PIPE:
PIPE is used to maintain stateful state.
It is used for DataFlow in a Program. We can also add the values,
Constructor values of one class and other class and display it.
It also list the values from the Bucket.
SYNTAX:
Pipe <<DATATYPE>> list11 = <NEW> Pipe <<DATATYPE>> (STRING);
list.KeyAdd(<DATATYPEVALUE>);
list.add(<DATATYPEVALUE>);
list.RandomAdd();
list.Display(list);
BUCKET:
Bucket are used to store key,value data, and Generated Random number
where datatype may be string ,object ,etc.
SYNTAX:
Bucket<DATATYPE> list = <NEW> Bucket<DATATYPE>(<DATATYPEVALUE>);
list.KeyAdd(<DATATYPEVALUE>);
list.add(<DATATYPEVALUE>);
list.RandomAdd();
list.Display(list);
Advantages
Using Bucket you can also Retrieve the values stored n position.
Searching and Insertion is fast than other DTS.
Random Indexing is possible.
eg) If you store a duplicate value such Random key will be different.
It also used to add many values.
EXTEND
Extend class is used in ,<WEB7> since to provide multiple inheritence
about 100000000 classes . Extends class also list values in methods and
constructor values.
Extend means a Bucket contains List of class and it is also
Behave like Bucket. So it is also one of the Advanced concepts in WEB7.0(OJ7).
SYNTAX:
EXTEND <<DATATYPE>> list11 = <NEW> EXTEND <<DATATYPE>> (STRING);
list.KeyAdd(<DATATYPEVALUE>);
list.add(<DATATYPEVALUE>);
list.RandomAdd();
list.Display(list);
Advantages:
It is also used to add many values
Indexing is possible
Value can also be list by index and behave like bucket.
It list only the class value and object value.
It is stateless.
PIPE:
PIPE is used to maintain stateful state.
It is used for DataFlow in a Program. We can also add the values,
Constructor values of one class and other class and display it.
It also list the values from the Bucket.
SYNTAX:
Pipe <<DATATYPE>> list11 = <NEW> Pipe <<DATATYPE>> (STRING);
list.KeyAdd(<DATATYPEVALUE>);
list.add(<DATATYPEVALUE>);
list.RandomAdd();
list.Display(list);
WEB7.0(OJ7) MAIN Program Syntax AND ADVANCED CONCEPTS PROGRAM.
(<filename>.web7)
Syntax:
<WEB7>
<PACK> <NAMESPACE>
<%
<CLASS> <CLASSNAME>
{
public void main()
{
<! WEB7.0(OJ7) LOGIC!>
%>
?>
BAG
Bag is the extension of LinkedHashmap and it is the fastest
datastructures than Dictionary.
SYNTAX:
Bag object = new Bag();
object .put(key,value);
Functions
getValues(key) => it is used to get the values for a particular key
get(key,loc) => it is used to get the value stored at a loc (indexing
purpose)
boolean containsValue(object Value) => To check the value present in bag or
not.
put(key,value) => it is used to add key and value in Bag
remove(key ,value) => It is used to remove key and value.
TreeList
TreeList simillar to Bucket but store items in tree format.
TreeList list = new TreeList ("BUCKETS");
list.KeyAdd(KEY);
list.add(VALUE1);
list.RandomAdd(RANDOMNO);
list.DisplayO(list,0);
MASK
It is the extension of Tree Structure and it can store many values
using mask object and we can also retrieve the values stored in mask.
Mask m = new Mask(<DATATYPE>);
m.add(multiple values);
m.getR(Loc); => Get the values stored in right position
m.getL(LOC) => Get the values stored in left position
HEAP:
Creates a tree , puts the data into tree in a fairly balanced way and displays
the tree's size and data in a tree by performing an inorder traversal.
Heap hob = new Heap(<datatype>);
hob.add(datum);
hob = new Heap(key,value1,value2);
Bucktist
Bucktist is simillar to Bucket but it is used to add two values with one key.
Bucktist l = null;
l= new Bucktist(key,value1,value2);
WICKET
Wicket is used to store multiple values using same object with 4 values per key.
Syntax:
Wicket list12;
list12=new Wicket(key,v1,v2,v3,v4);
list12.Display();
list12.Display(list12,location);
EXAMPLE -1: BAG
<WEB7>
<PACK> MyP
<%
<CLASS> Programs
{
public void main()
{
Bag b <NEW> Bag();
b.PUT(1,34);
b.PUT(2,444);
<PRINTLN>(""+b);
%>
?>
EXAMPLE:2 : WEB7.0-CDOLLARARRAYS
<WEB7>
<USE> CUTIL;
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
ArrayList ar <NEW> ArrayList ();
for (int i=0;i<=100;i++)
ar.add(i,i);
<CDOLLARARRAYS> list1 <NEW> <CDOLLARARRAYS>("ANIMALS ");
list1.add("1 horse");
list1.add("2 pig");
list1.add("3 cow");
list1.add("4 goat");
list1.add("5 chicken");
list1.add("6 ostrich");
list1.add(ar.StringConvert());
for (int i=0;i<list1.size();i++)
<PRINTLN>(""+list1.get(i));
%>
?>
Note: <CDOLLARARRAYS> is a Keyword belong to WEB7.0(OJ7)
EXAMPLE-3: CREATE AN BOOTLOADER Using WEB7.0
<WEB7>
<USE> CUTIL;
<PACK> MYOS
{
<CLASS> MYOs
{
public void main(){
<PRINTLN>("HelloWorld for booting MYOS");
%>
?>
EXAMPE-4: POINTERS
<WEB7>
<USE> CUTIL;
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
<Str> s="dsdds";
{*} l Pointers (s);
l.add(s);
for (int i = 0; i NOT= l.size(); i = i + 1)
{
<OBJECT> obj=l.GETKEY(i);
<PRINTLN>(obj);
}
%>
?>
EXAMPLE-5: DICTIONARY
<WEB7>
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
Dictionary<string, string> openWith <NEW> Dictionary<string, string>();
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
%>
?>
Example-6: EXTEND
<WEB7>
<USE> CUTIL;
<IMPORT>
<PACK> MyP
<%
<CLASS> Programs
<%
public void main()
{
EXTEND list <NEW> EXTEND("BUCKETS");
list.KeyAdd("1101");
list.add("jemin");
list.RandomAdd();
list.Display(list);
<PRINTLN>(""+list.DisplayO(list,1));
%>
?>
EXAMPLE-7: HEAP
<WEB7>
<USE> CUTIL;
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
Heap root <NEW> Heap("wilmix");
for (int i = 0; i <= 10; i = i + 1)
{
root.add("item " + i);
}
<PRINTLN>(root.size() );
root.printTree();
%>
?>
Example-8: LArray
<WEB7>
<USE> CUTIL;
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
LArray root <NEW> LArray("root");
ArrayList ar <NEW> ArrayList();
for (int i=0;i<=1000;i++)
ar.add(i,i);
root.add("wilmix");
root.add("jemin");
root.add("shalom");
root.add("1010");
root.add("101");
root.add("201");
root.add(ar.StringConvert());
root.add("100000000");
//print the tree's size and contents
root.printTree();
%>
?>
Example-9 : PIPE
<WEB7>
<USE> CUTIL;
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
Pipe list <NEW> Pipe("BUCKETS");
list.KeyAdd("1101");
list.add("jemin");
list.RandomAdd();
list.Display(list);
<PRINTLN>(""+list.DisplayO(list,1));
%>
?>
EXAMPLE-10: TREELIST
<WEB7>
<USE> CUTIL;
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
TreeList list <NEW> TreeList ("BUCKETS");
list.KeyAdd("1101");
list.add("jemin");
list.RandomAdd("1111");
TreeList list2 <NEW> TreeList("BUCKETS");
list2.KeyAdd("1102");
list2.add("rahul");
list2.RandomAdd("1112");
<PRINTLN>("DATA="+list.DisplayO(list,0));
<PRINTLN>("DATA="+list2.DisplayO(list2,0));
%>
?>
Example-11 : MASK
<WEB7>
<USE> CUTIL;
<PACK> My
{
<CLASS> Programs
{
public void main()
{
MASK root <NEW> MASK("wilmix");
for (int i = 0; i NOT= 10; i = i + 1)
{
root.add("item " + i);
}
root <NEW> MASK("root1",1211211,54441);
root <NEW> MASK("root2",121121,5444);
root <NEW> MASK("root5",99121888,"5");
root <NEW> MASK("root3",12112,544);
root <NEW> MASK("root4",1211,54);
root <NEW> MASK("root51",121,5);
root.printTree();
%>
?>
Example-12 : WICKET
<WEB7>
<USE> CUTIL;
<PACK> MyPo
{
<CLASS> Programs
{
public void main()
{
Wicket list12;
list12 <NEW> Wicket(1000,10002,43433,4343,5555451);
list12 <NEW> Wicket(10001,100021,434331,4343,5555452);
list12 <NEW> Wicket(10002,100022,434332,4343,5555453);
list12 <NEW> Wicket(10003,100023,434333,4343,5555454);
list12 <NEW> Wicket(10004,100024,434334,4343,5555455);
list12 <NEW> Wicket(10005,100025,434335,4343,5555456);
list12.Display(list12);
<PRINTLN>("DATA="+list12.DisplayO(list12,0));
%>
?>
Example-13 : STRUCTURE
<WEB7>
<USE> CUTIL;
<PACK> MyPoi
{
<CLASS> Programs
{
public void main()
{
<Str> s="dsdds";
{*} l Pointers(s);
l.add(s);
for (int i = 0; i NOT= l.size(); i = i + 1)
{
<OBJECT> obj=l.GETKEY(i);
<PRINTLN>(obj);
}
<STRUCTURE> list <NEW> <STRUCTURE> (l.GETKEY(0));
for (int i11 = 0; i11 NOT= list.size(); i11 = i11 + 1)
{
<OBJECT> el=list.ret(i11);
<PRINTLN>("SNO= "+el);
}
%>
?>
Example-14 : BUCKETIST
<WEB7>
<USE> CUTIL;
<PACK> MyP
{
<CLASS> Programs
{
public void main()
{
Bucketist bp <NEW> Bucketist("wilmix");
bp <NEW> Bucketist(1,222,434);
bp <NEW> Bucketist(1,222,434);
bp.Display(bp);
<PRINTLN>("DATA="+bp.DisplayO(bp,1));
%>
?>
====================================================================================
UNIT 4 : WEB7.0(OJ7) Advanced OOPS
======================================================================================
WEB7.0(OJ7) Advanced OOPS
WEB7.0(OJ7) Advanced Oops add features like
Operator overloading , friend function,Gdollar oops,Jstar oops,
Chdollar oops , JDk-java oops, and ,WEB7.0(OJ7) oops.
We already know about the concepts like JDollar shell packages, oops,Gdollar oops,Jstar oops,
Chdollar oops. But java developers did not know about WEB7.0(OJ7) Advanced concepts.
WEB7.0(OJ7) FILEAPIS
JFile. display(String f1) => Display the file attributes
JFileInputStream.ReadBytes(String f1,int p) => This is used to readbytes form the file
JFileOutputStream.Write(String data,String f1 ,String f2, String f3,int r1,int r2) => This is used to write a databytes to a file
JFileReader.Read(String f1,int d) => This is used to read from file
JFileWriter.Write( String f1, char data[], String f2, String f3,String app,int r1,int r2) => This is used to write a data to a file
JInputStreamReader.ReadLN() => it is used to read a character for a file
JPrinter.call() => Printer enabled
JPrintWriter.display(String s1) => Write a String
JSerialization.Serialize(String a,String s1,String s2) => Serialize and deserilaize a string
JStreamTokenizer.Split(String f1) => Split the String to tokens.
Program1.java7
<JAVA>
<USE> <WEB7>.IO; // WEB7.0(OJ7) IO Package
<USE> CUTIL;
<PACK> BoxApplication
{
<CLASS> Box
{
private double length; // Length of a box
private double breadth; // Breadth of a box
private double height; // Height of a box
public void setLength( double len )
<%
length = len;
}
public void setBreadth( double bre )
<%
breadth = bre;
}
public void setHeight( double hei )
<%
height = hei;
}
public double getVolume()
<%
return length * breadth * height;
}
}
<CLASS> Boxtester
{
public void main()
{
Box Box1 <NEW> Box(); // Declare Box1 of type Box
Box Box2 <NEW> Box();
double volume;
// Declare Box2 of type Box
// box 1 specification
Box1.setLength(6.0);
Box1.setBreadth(7.0);
Box1.setHeight(5.0);
// box 2 specification
Box2.setLength(12.0);
Box2.setBreadth(13.0);
Box2.setHeight(10.0);
// volume of box 1
volume = Box1.getVolume();
<PRINTLN>("Volume of Box1 :" +volume);
// volume of box 2
volume = Box2.getVolume();
// <PRINTLN>("Volume of Box2 : {0}", volume);
// Console.ReadKey();
CUTIL.ArrayList x <NEW> CUTIL.ArrayList();
// test size
<PRINTLN>("Initial size is " + x.size());
// test isEmpty
if (x.isEmpty())
<PRINTLN>("The list is empty");
else <PRINTLN>("The list is not empty");
// put datafrom file Java7Model.model
x.add(0, Java7Collection.QUERY());
x.add(1, (6));
x.add(0, (1));
x.add(2, (4));
<PRINTLN>("List size is " + x.size());
// test toString
<PRINTLN>("The list is " + x);
//insert value into Java7Model.model
Java7Collection.InsertQUERY(x.ToString());
// test indexOf
int index = x.indexOf((4));
if (index < 0)
<PRINTLN>("4 not found");
else <PRINTLN>("The index of 4 is " + index);
index = x.indexOf((3));
if (index < 0)
<PRINTLN>("3 not found");
else <PRINTLN>("The index of 3 is " + index);
// test get
<PRINTLN>("Element at 0 is " + x.get(0));
<PRINTLN>("Element at 3 is " + x.get(3));
// test remove
<PRINTLN>(x.remove(1) + " removed");
<PRINTLN>("The list is " + x);
<PRINTLN>(x.remove(2) + " removed");
<PRINTLN>("The list is " + x);
if (x.isEmpty())
<PRINTLN>("The list is empty");
else <PRINTLN>("The list is not empty");
<PRINTLN>("List size is " + x.size());
}
}
}
=======================================================
Program -2:oakweb1.java7
<JAVA7>
<CLASS> oakweb1
<%
void display()
<%
<PRINTLINE>("wilmix is going");
%>
%>
<CLASS> oakweb2
<%
<MAIN>
// it means it cannot be run in jdk1.8 compiler
<%
oakweb1 o <NEW> oakweb1();
<PRINTLINE>("Wilmix is going");
%>
</JAVA7>
Compile the program using
webc7 oakjava1.java7
Run the program using
webj7 oakjava2
Output:
Wilmix is going
=============================================================================
Note: This WEB7.0(OJ7) Programming Tutorial is under construction