Basic Syntax of java

When we consider a Java program, it can be defined as a collection of objects that communicate via invoking each other's methods. Let us now briefly look into what do class, object, methods, and instance variables mean.  Object - Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behavior such as wagging their tail, barking, eating. An object is an instance of a class. Class - A class can be defined as a template/blueprint that describes the behavior/state that the object of its type supports. Methods - A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed. Instance Variables - Each object has its unique set of instance variables. An object's state is created by the values assigned to these instance variables. First Java Program Let us look at a simple code that will print the words Hello World. public class MyFirstJavaProgram { /* This is my first java program. * This will print 'Hello World' as the output */ public static void main(String []args) { System.out.println("Hello World"); // prints Hello World } } Let's look at how to save the file, compile, and run the program. Please follow the subsequent steps: Open notepad and add the code as above. Save the file as: MyFirstJavaProgram.java. Open a command prompt window and go to the directory where you saved the class. Assume it's C:\. 3. Java – Basic Syntax Java 8 Type 'javac MyFirstJavaProgram.java' and press enter to compile your code. If there are no errors in your code, the command prompt will take you to the next line (Assumption : The path variable is set).  Now, type ' java MyFirstJavaProgram ' to run your program. You will be able to see ' Hello World ' printed on the window. C:\> javac MyFirstJavaProgram.java C:\> java MyFirstJavaProgram Hello World Basic Syntax About Java programs, it is very important to keep in mind the following points. Case Sensitivity - Java is case sensitive, which means identifier Helloand hello would have different meaning in Java. Class Names - For all class names the first letter should be in Upper Case. If several words are used to form a name of the class, each inner word's first letter should be in Upper Case. Example: class MyFirstJavaClass Method Names - All method names should start with a Lower Case letter. If several words are used to form the name of the method, then each inner word's first letter should be in Upper Case. Example: public void myMethodName() Program File Name - Name of the program file should exactly match the class name. When saving the file, you should save it using the class name (Remember Java is case sensitive) and append '.java' to the end of the name (if the file name and the class name do not match, your program will not compile). Example: Assume 'MyFirstJavaProgram' is the class name. Then the file should be saved as 'MyFirstJavaProgram.java' public static void main(String args[]) - Java program processing starts from the main() method which is a mandatory part of every Java program. Java 9 Java Identifiers All Java components require names. Names used for classes, variables, and methods are called identifiers. In Java, there are several points to remember about identifiers. They are as follows: All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_). After the first character, identifiers can have any combination of characters. A key word cannot be used as an identifier. Most importantly, identifiers are case sensitive. Examples of legal identifiers: age, $salary, _value, __1_value. Examples of illegal identifiers: 123abc, -salary. Java Modifiers Like other languages, it is possible to modify classes, methods, etc., by using modifiers. There are two categories of modifiers: Access Modifiers: default, public , protected, private Non-access Modifiers: final, abstract, strictfp We will be looking into more details about modifiers in the next section.

History of Java

James Gosling initiated Java language project in June 1991 for use in one of his many settop box projects. The language, initially called ‘Oak’ after an oak tree that stood outside Gosling's office, also went by the name ‘Green’ and ended up later being renamed as Java, from a list of random words. Sun released the first public implementation as Java 1.0 in 1995. It promised Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms. On 13 November, 2006, Sun released much of Java as free and open source software under the terms of the GNU General Public License (GPL). On 8 May, 2007, Sun finished the process, making all of Java's core code free and opensource, aside from a small portion of code to which Sun did not hold the copyright. Tools You Will Need For performing the examples discussed in this tutorial, you will need a Pentium 200-MHz computer with a minimum of 64 MB of RAM (128 MB of RAM recommended). You will also need the following softwares: Linux 7.1 or Windows xp/7/8 operating system Java JDK 8 Microsoft Notepad or any other text editor This tutorial will provide the necessary skills to create GUI, networking, and web applications using Java. Java 4 Try It Option We have provided you with an option to compile and execute available code online. Just click the Try it button avaiable at the top-right corner of the code window to compile and execute the available code. The

Application of Clipping

Applications of clipping:It will extract part we desire.For identifying the visible and invisible area in the 3D object.For creating objects using solid modeling.For drawing operations.Operations related to the pointing of an object.For deleting, copying, moving part of an object.Clipping can be applied to world co-ordinates. The contents inside the window will be mapped to device co-ordinates. Another alternative is a complete world co-ordinates picture is assigned to device co-ordinates, and then clipping of viewport boundaries is done.Types of Clipping:Point ClippingLine ClippingArea Clipping (Polygon)Curve ClippingText ClippingExterior Clipping

Importance of good design

With today's technology and tools, and our motivation to create really effective and usableinterfaces and screens, why do we continue to produce systems that are inefficient and confusing or, at worst, just plain unusable? Is it because:• We don't care?• We don't possess common sense?• We don't have the time?• We still don't know what really makes good design?• But we never seem to have time to find out what makes good design, nor to properly apply it. After all, many of us have other things to do in addition to designing interfacesand screens.• So we take our best shot given the workload and time constraints imposed upon us. The result, too often, is woefully inadequate.• Interface and screen design were really a matter of common sense, we developers would have been producing almost identical screens for representing the real world.• Example bad designs– Closed door with complete wood– suggestion : glass doorTHE IMPORTANCE OF THE USER INTERFACE A well-designed interface and screen is terribly important to our users. It is their window to view the capabilities of the system. It is also the vehicle through which many critical tasks are presented. These tasks often have a direct impact on an organization's relations with its customers, and itsprofitability. A screen's layout and appearance affect a person in a variety of ways. If they are confusing and inefficient, people will have greater difficulty in doing their jobs andwill make more mistakes. Poor design may even chase some people away from a system permanently. It can also lead to aggravation, frustration, and increased stress.The Benefits of Good Design Poor clarity forced screen users to spend one extra second per screen.o Almost one additional year would be required to process all screens.o Twenty extra seconds in screen usage time adds an additional 14 person

HCI Notes

INTRODUCTIONHuman–computer interaction (HCI), alternatively man–machine interaction (MMI) or computer–human interaction (CHI) is the study of interaction between people (users) and computers.• With today's technology and tools, and our motivation to create really effective and usable interfaces and screens, why do we continue to produce systems that are inefficient and confusing or, at worst, just plain unusable? Is it because:1. We don't care?2. We don't possess common sense?3. We don't have the time?4. We still don't know what really makes good design?DEFINITION• "Human-computer interaction is a discipline concerned with the design, evaluation and implementation of interactive computing systems for human use and with the study of major phenomena surrounding them."GOALS• A basic goal of HCI is– to improve the interactions between users and computers– by making computers more usable and receptive to the user's needs.• A long term goal of HCI is– to design systems that minimize the barrier between the human's cognitive model of what they want– to accomplish and the computer's understanding of the user's taskWHY IS HCI IMPORTANT• User-centered design is getting a crucial role!• It is getting more important today to increase competitiveness via HCI studies (Norman, 1990)• High-cost e-transformation investments• Users lose time with badly designed products and services• Users even give up using bad interface– Ineffective allocation of resources