In JAVA, I have to create a simple project that consists of creating a t.u.t.o.r
ID: 3854375 • Letter: I
Question
In JAVA, I have to create a simple project that consists of creating a t.u.t.o.r.i.a.l for your classmates. I'm not sure how to start it but it will be about how to strap in a toddler car seat , but include five major competencies of this course: 1. Explain the development of Java applications. 2. Explain the control structures in Java. 3. Utilize Methods and Arrays in Java. 4. Utilize string and character manipulation in Java. 5. Utilize Object-Oriented programming concepts in Java. Has to be in 2 parts. Written part explaining how a car seat is installed and a working program to show classmates.
Explanation / Answer
1.Developing General Java Applications In Net Beans IDE:
The following are the basic steps of developing a Java SE application
in Net Beans IDE.
=>Project Setup
=>Creating and Editing Java Source Code
=>Compiling and Running the Application
=>Testing and Debugging the Application
=>Building, Running, and Distributing the Application.
*Project Setup
To Create application you will contain two projects:
1.A Java Class Library project in which you will create a utility class.
2.A Java Application project with a main class that implements a
method from the library project's utility class.
=> For Creating a Java Class Library Project
We Follow Below Steps:
1.Choose File New Project (Carl-Shift-N).
Under Categories, select Java. Under Projects, select Java Class
Library. Click Next.
2.Under Project Name, type My Lib.
Change the Project Location to any directory on your computer.
3.Click Finish. The My Lib project opens in both the Projects window
and the Files window.
=>Creating a Java Application Project
1. Choose File > New Project. Under Categories, select Java.
Under Projects, select Java Application. Click Next.
2.Under Project Name, type My App. Make sure the Project Location is
set to NetBeansProjects.
3.Enter acrostic.Main as the main class.Ensure that the Create Main
Class check box is checked.
4.Click Finish. The My App project is displayed in the Project window
and Main.java opens in the Source Editor
*Creating and Editing Java Source Code
Now We Have to create a Java package
=> For Creating a Java Package and Class File
1.Right-click the My Lib project node and choose New > Java Class.
Type Lib Class as the name for the new class, type org.name.my lib in
the Package field, and click Finish.
Now MyClass.java opens in the Source Editor.
In MyClass.java,
public class Lib Class
{
public static String acrostic(String[] args)
{
System.out.printf("Hello world");
}
}
=>Compiling and Running the Application
By default, the projects have been created with the Compile on
Save feature enabled,
so we do not need to compile code first in order to run the
application in the IDE.
=>Running the Application
To run the application in the IDE:
Right-click the My App project node and choose Clean and Build.
Choose Run > Run Project (F6).
=>Building, Running, and Distributing the Application
The main build command in the IDE is the Clean and Build command.
To build the application:
->Choose Run > Clean and Build Project (Shift-F11).
->Output from the Ant build script appears in the Output window.
=>Distributing the Application to Other Users
To distribute the application:
->On your system, create a zip file that contains the application
JAR file (My App.jar) and the accompanying lib folder that contains My
Lib.jar.
->Send the file to the people who will use the application.
II.Control Structure in JAVA.
control structures to organize the execution of the program. A
control structure might cause a statement to be executed once,
several times, or not at all.
The Control Structure of java Contains Following Statements:
1.Assignment Statement
An assignment statement in Java has two parts. It has a variable
on the left-hand side-and an expression on the right.
The expression is first evaluated to yield a value. That value is
then used as the new value of the variable.
Example :int a=30,b;
b=a+12;
2.Conditional statements in JAVA:
A conditional statement allows a choice from a selection of
statements. It first evaluates an expression to decide between the
possibilities.
The Control Structure have The Following Statement;
3.Selection Statements:
Selection statements allow you to control the flow of program
execution on the basis of the outcome of an expression or state of a
variable known during run time.
There are Different types of Selection Statements:
if and if-else statements
if-else statements
if-else-if statements
Switch Statement Used For Selecting List of Expressions.Based on
Integer or Character Based Expression.
The switch statement introduces four new keywords,switch, case,
default and break.
Which follows Syntax as:
Switch(expression)
{
case 1:
//statements;
break;
case 2:
//Statements;
break;
case n:
break;
}
4.The Loop Statements:
The Loop or Iteration Statements Are Used For Executing No Of
Statements in Single Block.There are Three Types Of Loop/Iteration
Statements.
Here Loop Means Repeatedly Executes Same Number of Instructions
Until Condition is Satisfied.
1.For Loop
2.While Loop.
3. Do-While Loop.
5.Jump Statements
Jump statements are used to unconditionally transfer the program
control to another part of the program.
Java provides the following jump statements:
break statement
continue statement
return statement
III.Utilizing Methods And Arrays in Java:
Where Array is Set of an Identical Elements referenced By same Name.
That is Used for Sharing The Common Name.
Java array is an object the contains elements of similar data
type. It is a data structure where we store similar elements.
We can store only fixed set of elements in a java array
it Follows The Syntax as;
int array[]=new Int[];will Refer The Memory For Particular Array Elements.
IV.Utilizing The String and Character Manipulation JAVA:
The java String is immutable Object i.e. it cannot be changed.
Whenever we change any string, a new instance is created.
For mutable string, you can use String Buffer and String Builder classes.
Generally The String is Group of Characters Enclosed In Double Quotes.
JAVA provides wrapper class Character for primitive data type char.
The Character class offers a number of useful class (i.e., static)
methods for manipulating characters.
You can create a Character object with the Character constructor
Character ch = new Character('a');
The Java compiler will also create a Character object.
For example, if you pass a primitive char into a method that
expects an object,
the compiler automatically converts the char to a Character.This
feature is called auto boxing or unboxing, if the conversion goes the
other way.
Example
// Here following primitive char 'a'
// is boxed into the Character object ch
Character ch = 'a';
// Here primitive 'x' is boxed for method test,
return is unboxed to char 'c'
char c = test('x');
There Are Different Method Available for Implementing Character Class.
V.Utilize The Object Oriented Programming Concepts in Java.
Java Supports Different Types of Object Oriented Features:
1.Encapsulation.
The Encapsulation is a Mechanism that is used for wrapping of data
And Binds the data together.Mainly it is used for Providing Security
to The Data.
We Using Private Access Modifier.
2.Inheritance:
The Concept of Inheritance is Mainly Used for Reusing of The
Data.Inheritance is Process of Acquiring the Properties from Base
Class to Derived Class.
The Inheritance is Mainly Achieved by Using The Public Access Modifier.
3.Abstraction:
The Abstraction is the Process of hiding the Internal Details Of
The Particular System.
Shows Only The Necessary Details.This is Achieved by Using
Abstract Keyword in JAVA.
4.PolyMorphism:
PolyMorphism is Nothing But One Thing Many Other Forms.
This is done by using Method Overloading And Method Overriding
Concepts in JAVA.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.