WKU society of software engineering page

WKU society of software engineering page *aimed to create student who can change the world with techlogy*

23/03/2017

እንኳን ደስ አላችሁ
ላለፉት ሁለት አመታት የወልቂጤ ዩኒቨርሲቲ የተመራቂ ተማሪዎች መጽሄት በጥራት እና ባማረ ዲዛይን የሰራው ሜኖ ማተሚያ ድርጅት የዘንድሮውን የተመራቂ ተማሪዎች መጽሄት ባማረና በልዩ አቀራረብ እና በተመጣጣኝ ዋጋ ለመስራት መስማማቱን በላቀ ደስታ ለመግለጽ እንወዳለን፡፡

http://wkusu.byethost7.com/blog/index.php?controller=post&action=view&id_post=17

SHARE AND LIKE

16/02/2017

---------------------------------------------ማሳሰቢያ፡------------------------------------
በቡድን ወይም በክፍል ማሰራት የምትፈልጉ ተማሪዎች ወደ ተማሪዎች ህብረት ጽ/ቤት ድረስ በመምጣት መመዝገብ የምትችሉ ሲሆን፤ይህዉም ሙሉ የስራ ሂደቱን ባለሙያዉ ግቢ ድረስ በመምጣት የሚጨርስ መሆኑን ለመግለፅ እንወዳለን፡፡

-------የወልቂጤ ዩኒቨርሲቲ ተማሪዎች ህብረት የተመራቂ ተማሪዎች ኮሚቴ------

03/01/2017

Tir 13/2009.
share, like, n comment things u think should be on the program

females dorm
28/09/2016

females dorm

14/12/2014

hey guys what do u think of HALF LIFE? I think of hawassa and langano!

30/09/2014

Are u ready to beat 2007?

23/09/2014

oh fresh students are coming in before the seniors. we wish we will have some students.

      java Chapter One1.0	Introduction to Object-Oriented Programming(OOP)What is Object-Oriented Programming?   Object ...
21/08/2014


java Chapter One
1.0 Introduction to Object-Oriented Programming(OOP)

What is Object-Oriented Programming?
Object Oriented Programming (OOP) is a different method of thinking about Programming. In procedural programming (structured), we think about methods and the ex*****on flow through these methods. We think separately about data and how the methods interact with data.
Object-Oriented Programming, however, forces us to think in terms of objects and the interaction between objects. An object is a self-contained entity that describes not only certain data, but also the procedures to maintain the data.
The basic problem solving method in OOP is slightly different from the procedural approach. In procedural approach, a problem is decomposed into sub-problems and this process is repeated until the subtasks can be coded. In contrast, in addition to this, an object oriented approach identifies the keywords in the problem. The keywords would be the object in the implementation and the hierarchy defines the relationship between these objects. The term object is used here to describe a limited well defined structure, containing all the information about some entity-data type and methods-to manipulate the data.

Why do we use Object-Oriented Programming?
• OOP enable us to model real-world problem through programs in more logical
manner
• Because objects are discrete entities, we can debug, modify and maintain them
more easily
• If our objects are thoughtfully designed, we can reuse much of our code than
is the case with procedural programming.
Java Program
Definition of Java Application, Java Applets

Java is a programming language in the tradition of C and C++. As a result, if You have any experience with C or C++, you’ll find yourself in familiar territory Often as you learn the various features of Java. However, Java differs from other programming languages in a couple of significant ways.
The following sections describe the most important differences
Platform independence: - One of the main reasons Java is so popular is its platform independence, which means simply that Java programs can be run on many different types of computers. A Java program runs on any computer with a Java Runtime Environment like, from PCs running any version of Windows, Macintosh computers, Unix or Linux computers, huge mainframe computers, and even cell phones. Before Java, other programming languages promised platform independence by providing compatible compilers for different platforms. (A compiler is the program that translates programs written in a programming language into a form that can actually run on a computer.) The idea was that you could compile different versions of the programs for each platform. Unfortunately, this idea never really worked. The compilers were never completely identical on each platform — each had its own little nuances. As a result, you had to maintain a different version of your program for each platform you wanted to support. Java’s platform independence isn’t based on providing compatible compilers for different platforms. Instead, Java is based on the concept of a virtual machine. You can think of the Java Virtual Machine (sometimes called the JVM) as a hypothetical computer platform — a design for a computer that doesn’t really exist on any actual computer. Instead, the Java Runtime Environment is an emulator that creates a Java Virtual Machine environment that can execute Java programs. The Java compiler doesn’t translate Java into the machine language of the computer the program is run on. Instead, the compiler translates Java into the machine language of the Java Virtual Machine, which is called bytecode. Then the Java Runtime Environment runs the bytecode in the JVM. Because of the JVM, you can execute a Java program on any computer that has a Java Runtime Environment installed, without recompiling the program.
Object orientation:- Java is inherently object-oriented, which means that Java programs are made
up from programming elements called objects. an object is a programming entity
that represents either some real-world object or an abstract concept.
All objects have two basic characteristics:

Objects have data, also known as state. For example, an object that represents
a book has data such as the book’s title, author, and publisher.
Objects also have behavior, which means that they can perform certain
tasks. In Java, these tasks are called methods. For example, an object
that represents a car might have methods such as start, stop, drive, or crash. Some methods simply allow you to access the object’s data. For
example, a book object might have a getTitle method that tells you
the book’s title.
Classes are closely related to objects. A class is the program code you write to create objects. The class describes the data and methods that define the object’s state and behavior. Then, when the program executes, classes are used to create objects. For example, suppose you’re writing a payroll program. This program probably needs objects to represent the company’s employees. So, the program includes a class (probably named Employee) that defines the data and methods for each employee object. Then, when your program runs, it uses this class to create an object for each of your company’s employees.
The Java API:- The Java language itself is very simple. However, Java comes with a library of classes that provide commonly used utility functions that most Java programs
can’t do without. This class library, called the Java API, is as much a part of Java as the language itself. In fact, the real challenge of learning how to use Java isn’t learning the language; it’s learning the API. The Java language has only 48 keywords, but the Java API has several thousand classes, with tens of thousands of methods you can use in your programs.
For example, the Java API has classes that let you do trigonometry, write data to files, create windows on-screen, or retrieve information from a database. Many of the classes in the API are general purpose and commonly used. For example, a whole series of classes stores collections of data. But many are obscure, used only in special situations.
The Internet:- Java is often associated with the Internet, and rightfully so. That’s because
Al Gore invented Java just a few days after he invented the Internet. Okay, Java wasn’t really invented by Al Gore. But Java was developed during the time that the Internet’s World Wide Web was becoming a phenomenon, and Java was specifically designed to take advantage of the Web. In particular, the whole concept behind the Java Virtual Machine is to allow any computer
that’s connected to the Internet to be able to run Java programs, regardless of the type of computer or the operating system it runs. You can find two distinct types of Java programs on the Internet:
Applets, which are Java programs that run directly within a Web browser. To run an applet, the browser starts a Java Virtual Machine, and that virtual machine is given a portion of the Web page to work with. Then the virtual machine runs the applet’s byte code. Applets are a grand idea. However, marketing and legal battles between Microsoft and Sun have left applets in a precarious situation. The problem is that not all Web browsers provide a JVM, and those that do often provide an old version that isn’t able to take advantage of the latest and greatest Java features.
Servlets, which are Web-based Java programs that run on an Internet
server computer rather than in an Internet user’s Web browser. Servlets are how many, if not most, commercial Web sites work. Basically, a servlet is a program that generates a page of HTML that is then sent to a user’s computer to be displayed in a Web browser. For example, if you request information about a product from an online store, the store’s Web server runs a servlet to generate the HTML page that contains the product information you requested.

Why Java?

Java is the fastest growing programming language in the world. Companies such as IBM
and Sun have adopted Java as the major application-development language. There are several reason for this. First, Java is a modern OOP. The designers of Java spent much time studying the features of classical OOP languages such as Smalltalk and C++, and made a successful effort to incorporate the good features and omit the less desirable ones. Second, Java is secure, robust and portable. That is, Java language
Enables the construction of virus-free, tamper-free system (Secure) Supports the developments of programs that do not overwrite memory (Robust)
Yields programs that can be run on different types of computers without
change (Portable) Third, Java supports the use of advanced programming concepts such as threads. A thread is a process that can run concurrently with other processes. Fourth and finally, Java bears a superficial resemblance to C++. Thus, it is easy for a C++ programmer to learn Java and for a Java programmer to learn C++. However, compared to C++, Java is easier to use and learn, and is less error prone, more portable and better suited to the internet. In the negative side, Java runs more slowly than most modern programming languages because it is interpreted. To understand this, let us see the Java Virtual Machine (JVM) and the Byte code.
The Java Virtual Machine and the Byte Code
Compilers usually translate a higher level language into the machine language of a
particular type of computer. However, the Java compiler translates Java not into machine
language but into a pseudo machine language called Java Byte code. Byte code is the machine language for imaginary Java computer. To run Java byte code on a particular computer, you must install a JVM on that computer.JVM is a program that behaves like a computer. Such a program is called an interpreter



Phase 1
A

Phase2 B

Phase3 C





Phase4 D

Phase5 E

Fig Typical Java environment of JVM

Let us see what will happen in each phase:
A: Program is created in an editor and stored on disk in a file ending withjava.
B: Compiler crates bytecodes and stores them on disk in a file ending withclass
C: Class loader reads .class files containing bytecodes from disk and puts
those bytecodes in memory
D: Bytecode verifier confirms that all bytecodes are valid and do not violate
Java’s security restrictions.
E: Interpreter reads bytecodes and translates them into a language that the
computer can understand, possibly storing data values as the program
executes.

Applets and Applications
Java applications fall into two main groups: applets and applications.
Applets, as you have learned, are Java programs that are downloaded over the World Wide Web and executed by a Web browser on the reader’s machine. Applets depend on a Java-capable browser in order to run (although they can also be viewed using a tool called the appletviewer, which you’ll learn about later today).
Java applications are more general programs written in the Java language. Java applications don’t require a browser to run, and in fact, Java can be used to create most other kinds of applications that you would normally use a more conventional programming language to create. HotJava itself is a Java application. A single Java program can be an applet or an application or both, depending on how you write that program and the capabilities that program uses. Everything that you learn while you’re creating simple Java applications will apply to creating applets, and it’s easier to start
Creating a Java Application
Let’s start by creating a simple Java application: the classic Hello World example that all language books use to begin. As with all programming languages, your Java source files are created in a plain text editor, or in an editor that can save files in plain ASCII without any formatting characters. On Unix, emacs, ped, or vi will work; on Windows, Notepad or DOS Edit are both text editors. Fire up your editor of choice, and enter the Java program shown in Listing 1.1. Type this program, as shown, in your text editor. Be careful that all the parentheses, braces, and quotes
class HelloWorld {
2: public static void main (String args[]) {
3: System.out.println(“Hello World!”);
}
}
Out put :-“ Hello World”
This program has two main parts:
All the program is enclosed in a class definition—here, a class called HelloWorld. The body of the program (here, just the one line) is contained in a routine called main(). In Java applications, as in a C or C++ program, main() is the first routine that is run when the program is executed.
You’ll learn more about both these parts of a Java application as the book progresses.Once you finish typing the program, save the file. Conventionally, Java source files are named the same name as the class they define, with an extension of .java. This file should therefore be called HelloWorld.java. Now, let’s compile the source file using the Java compiler. In Sun’s JDK, the Java compiler is called javac. To compile your Java program, Make sure the javac program is in your ex*****on path and type javac followed by the name of your source file:
javac HelloWorld.java The compiler should compile the file without any errors. If you get errors, go back and make sure that you’ve typed the program exactly as it appears in Listing 1.1. When the program compiles without errors, you end up with a file called HelloWorld.class, in the same directory as your source file. This is your Java bytecode file. You can then run that bytecode file using the Java interpreter. In the JDK, the Java interpreter is called simply java. Make sure the java program is in your path and type java followed by the name of the file without the .class extension: java HelloWorld
Creating a Java Applet
Creating applets is different from creating a simple application, because Java applets run and are
displayed inside a Web page with other page elements and as such have special rules for how they behave. Because of these special rules for applets in many cases (particularly the simple ones), creating an applet may be more complex than creating an application. For example, to do a simple Hello World applet, instead of merely being able to print a message, you have to create an applet to make space for your message and then use graphics operations to paint the message to the screen.

Editing, Compiling and Interpreting
Before we look at how the program works, we must first discuss how to run it. In order to compile and run the program, you need a Java software development kit (SDK) of some sort. Sun Microsystems created the Java language and ships a free Java SDK for its Solaris operating system and for Microsoft Windows . At the time of this writing, the current version of Sun's SDK is entitled Java 2 SDK, Standard Edition, Version 1.2.2 and is available for download fromhttp://java.sun.com/products/jdk/1.2/ (Sun's Java SDK is still often called the JDK, even internally). Be sure to get the SDK and not the Java Runtime Environment. The JRE enables you to run existing Java programs, but not to write your own.
Sun supports its SDK only on Solaris and Windows platforms. Many other companies have licensed and ported the SDK to their platforms, however. Contact your operating-system vendor to find if a version of the Java SDK is available for your system. Linux users should visit http://www.blackdown.org/.
The Sun SDK is not the only Java programming environment you can use. Companies such as Borland, Inprise, Metrowerks, Oracle, Sybase, and Symantec offer commercial products that enable you to write Java programs. This book assumes that you are using Sun's SDK. If you are using a product from some other vendor, be sure
Once you have a Java programming environment installed, the first step towards running our program is to type it in. Using your favorite text editor, enter the program. Note that Java is a case-sensitive language, so you must type lowercase letters in lowercase and uppercase letters in uppercase. It is a common mistake to forget semicolons, but the program won't work without them, so be careful! If you are not a fast typist, you can omit everything from // to the end of a line. Those are comments ; they are there for your benefit and are ignored by Java.
When writing Java programs, you should use a text editor that saves files in plain-text format, not a word processor that supports fonts and formatting and saves files in a proprietary format. If you use a Windows system, you might use Notepad or WordPad, if you don't have a more specialized programmer's editor. If you are using a commercial Java programming environment, it probably includes an appropriate text editor; read the documentation that came with the product.
After writing a program like this one, the next step is to compile it. With Sun's SDK, the Java compiler is known as javac. javac is a command-line tool, so you can only use it from a terminal window, such as an MS-DOS window on a Windows system or an xterm window on a Unix system. Compile the program by typing the following command line
The "C:\>" characters represent the command-line prompt; don't type these characters yourself.
C:\> javac Factorial.java
If this command prints any error messages, you probably got something wrong when you typed in the program. If it does not print any error messages, however, the compilation has succeeded, and javac creates a file called Factorial.class. This is the compiled version of the program.
Once you have compiled a Java program, you must still run it. Unlike some other languages, Java programs are not compiled into native machine language, so they cannot be executed directly by the system. Instead, they are run by another program known as the Java interpreter. In Sun's SDK, the interpreter is a command-line program named, appropriately enough, java. To run the factorial program, type:
C:\> java Factorial 4
java is the command to run the Java interpreter, Factorial is the name of the Java program we want the interpreter to run, and 4 is the input data--the number we want the interpreter to compute the factorial of. The program prints a single line of output, telling us that the factorial of 4 is 24:
C:\> java Factorial 4
24.0

Oracle Technology Network is the ultimate, complete, and authoritative source of technical information and learning about Java.

04/07/2014

Documentation is the castor oil of programming. Managers think it is good for programmers and programmers hate it!.

Address

Wolkite

Alerts

Be the first to know and let us send you an email when WKU society of software engineering page posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Shortcuts

Share