How  to Create Simple Hello World Grails Application

for more Please visit: http://jtechies.in/grails/

Download Projects

Posted: July 2, 2017 in Introduction of JAVA

Download Projects : (Download Projects)

  • Hospital Management Systems
  • MVC Web Application with Hibernate
  • download----.png
Advertisement

Overloading

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();

}
}

Inner Class:

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();

}
}

Enum Concept:

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);
}
}

Various java useful commands:

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

Java ANT

Posted: August 25, 2012 in Introduction of 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

  • Ant is build IN Java, USING Java, and FOR Java
  • It supports Java Tools such as javac, javadoc, etc.
  • Ant simplifies the process of building, read an XML File Build and Maintain then MAKE file
  • It is easier to extend
  • It also supports Cross Platform Java Development
  • It is much faster than using MAKE ? Each command in ant works as a new process
  • It runs from within the JVM
  • Each command in ant is executed from within JVM
  • Tools such as javac are new threads rather than new process
  • Compiling large number of java source files is MUCH, faster with Ant
  • Ant’s provides very helpful Debugging Options
  • Ant provides easier processing of reading an XML file than MAKEFILE
  • User does not need to have knowledge about all command line interface options to tools that can be called programmatically
  • Even a user can set up OS-Specific commands in ‘TaskDefs’ and/or included from other sources

download..short notes

Posted: July 1, 2012 in Uncategorized

Now download the Short notes from the download section…

Redirect the download page click here….download

struts 2.0

Posted: June 22, 2012 in Uncategorized

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.

  • Build!
    • Easy startup – Jumpstart new projects with our bootstrap tutorial and template application or Maven archetype.
    • Improved Design – Code clean against HTTP-independant framework interfaces.
    • Enhanced Tags – Code less with stylesheet-driven form tags that provide their own markup.
    • Stateful Checkboxes – Avoid special handling with smart checkboxes that know when they are toggled.
    • Flexible Cancel Buttons – Go directly to a different action on cancel.
    • First-class AJAX support – Add interactivity and flexibility with AJAX tags that look and feel just like standard Struts tags.
    • Easy Spring integration – Inject dependencies into Actions using Spring without glue code or red tape. (Plexus support also available.)
    • Enhanced Results – Do more with speciality results for JasperReports, JFreeChart, Action chaining, and file downloading.
    • POJO forms – No more ActionForms! Use any JavaBean to capture form input or put properties directly on an Action class. Use both binary and String properties!
    • POJO Actions – Use any class as an Action class — even the interface is optional!
  • Deploy!
    • Easy plugins – Add framework extensions by dropping in a JAR. No manual configuration required! Bundled plugins add support for JavaServer Faces, JasperReports, JFreeChart, Tiles, and more …
    • Integrated profiling – Peek inside Struts2 to find where the cycles are going!
    • Precise Error Reporting – Flip directly to the location and line of an error.
  • Maintain!
    • Easy-to-test Actions – Test Struts2 Actions directly, without resorting to mock HTTP objects.
    • Intelligent Defaults – Skip obvious and redundant settings. Most framework configuration elements have a default value that we can set and forget. Say it once!
    • Easy-to-customize controller – Customize the request handling per action, if desired. Struts2 only does what you want it to do!
    • Integrating Debugging – Research problem reports with built-in debugging tools.
    • Easy-to-tweak tags – Customize tag markup by editing a FreeMarker template. No need to grok the taglib API! JSP, FreeMarker, and Velocity tags are fully supported.

java Basics

Posted: May 23, 2012 in Introduction of JAVA

servlet

Posted: May 20, 2012 in Advanced java Question

servlet.

Q1. what is servlet ?

Q2. What is jsp page?

Q3. JSTL/EL why java Uses?

Q4. what is Model View control?

Q5. what is MVC2 ?

Q6 what is taglib ?

Q7. what is pagination ?

Q8. what is Struts ?

Link  —  Posted: May 20, 2012 in Advanced java Question