How to Create Simple Hello World Grails Application
for more Please visit: http://jtechies.in/grails/
How to Create Simple Hello World Grails Application
for more Please visit: http://jtechies.in/grails/
Download Projects : (Download Projects)
package project1;
public class Class1 {
public Class1() {
}
// static void show(int …a) {
// for(int z : a) {
// System.out.println(z);
// }
// }
// static void show(int x , int…a) {
// for(int z : a) {
// System.out.println(z);
// }
// }
static void show(float x, int …a) {
for(int z : a) {
System.out.println(z);
}
}
// static void show(int …x, float y) {
//
// }
public static void main(String[] args) {
show(10.20f, 90);
// show(1, new int[]{1,2,3});
//
// show(new int[]{1});
// show(new int[]{1,2});
// show(new int[]{1,2,3});
// show();
}
}
package project1;
class Z {
static void show() {
final int e = 90;
class Y {
void output() {
System.out.println(“Output … “+e);
}
}
Y obj =new Y();
obj.output();
}
}
public class Class3 {
public Class3() {
}
public static void main(String[] args) {
Z.show();
}
}
package project1;
enum DatabaseEnum {
DSN(“MY_DSN”), ORACLE(“192.33.44.66”);
private DatabaseEnum(String dsnName) {
this.dsnName = dsnName;
}
private String dsnName;
public String getDsnName() {
return dsnName;
}
}
enum Color {
RED(1), GREEN(2), BLUE(3);
private Color(int code) {
this.code = code;
}
private int code;
public int getCode() {
return code;
}
};
public class Class2 {
enum DAYS {SUNDAY, MONDAY };
public Class2() {
}
public static void main(String[] args) {
Color c = Color.RED;
int code = c.getCode();
System.out.println(“Now Color is “+c);
System.out.println(“Now Code is “+code);
// switch(c) {
// case RED:
// System.out.println(“RED COLOR “);
// break;
// case GREEN:
// System.out.println(“GREEN COLOR “);
// break;
// case BLUE:
// System.out.println(“BLUE COLOR “);
// break;
// }
// System.out.println(c);
}
}
javac: to complie the java program we use that command.
Sysntax: c:\javac Hello.java //press enter
javap: that command is used to read the class file and again give the actual program on the dos window.
sysntax: c:\javac Hello.java //press enter
c:\javap Hello //press Enter
for help:
syntax: javac -help //press enter
show the all java compilation step on dos window
c:\javac Hello.java -verbose //press enter
c:\javac Hello.java -verbose>iee.text // to save the all compilation log in to the text file at the same location where java program exist.
c:\javac -d . Hello.java // press enter
it will the output like that
.com\java\Hello.java
Ant is a build tool based on java that provides better support in development of java applications. The applications developed by using the ant build tool resolves various cross platform issues. All the java projects at Apache projects and and many other Open Source Java projects uses ant as the build tool. Ant is used in order to perform various task such compilation of java source code files, build your deployment JAR and WAR files, unit-test code and create projects javadoc documentation.
A lot of new features are added to ant 1.6.0, most of them support for XML namespaces having new concept of Ant libraries that allows of using namespaces in order to avoid name clashes of custom tasks.
Benefits of Ant
Now download the Short notes from the download section…
Redirect the download page click here….download
Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time.
Apache Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities joined forces to create Struts2. This new version of Struts is simpler to use and closer to how Struts was always meant to be.
Link
—
Posted: May 20, 2012 in Advanced java Question