IT301-VISUAL PROGRAMMING 2019-20 Sir Syed University of ...



LAB SESSIONObject: To get familiar with IDE, Netbeans, concept of classes, super and subclasses, and nested class.INTRODUCTION TO NETBEANSNetBeans IDE lets you quickly and easily develop Java desktop, mobile, and web applications, as well as HTML5 applications with HTML, JavaScript, and CSS. The IDE also provides a great set of tools for PHP and C/C++ developers. It is free and open source and has a large community of users and developers around the world.Best Support for Latest Java TechnologiesNetBeans IDE is the official IDE for Java 8. With its editors, code analyzers, and converters, you can quickly and smoothly upgrade your applications to use new Java 8 language constructs, such as lambdas, functional operations, and method references.Batch analyzers and converters are provided to search through multiple applications at the same time, matching patterns for conversion to new Java 8 language constructs.With its constantly improving Java Editor, many rich features and an extensive range of tools, templates and samples, NetBeans IDE sets the standard for developing with cutting edge technologies out of the box.Fast & Smart Code EditingAn IDE is much more than a text editor. The NetBeans Editor indents lines, matches words and brackets, and highlights source code syntactically and semantically. It lets you easily refactor code, with a range of handy and powerful tools, while it also provides code templates, coding tips, and code generators.The editor supports many languages from Java, C/C++, XML and HTML, to PHP, Groovy, Javadoc, JavaScript and JSP. Because the editor is extensible, you can plug in support for many other languages.Easy & Efficient Project ManagementKeeping a clear overview of large applications, with thousands of folders and files, and millions of lines of code, is a daunting task. NetBeans IDE provides different views of your data, from multiple project windows to helpful tools for setting up your applications and managing them efficiently, letting you drill down into your data quickly and easily, while giving you versioning tools via Subversion, Mercurial, and Git integration out of the box.When new developers join your project, they can understand the structure of your application because your code is well-organized.Rapid User Interface DevelopmentDesign GUIs for Java SE, HTML5, Java EE, PHP, C/C++, and Java ME applications quickly and smoothly by using editors and drag-and-drop tools in the IDE.For Java SE applications, the NetBeans GUI Builder automatically takes care of correct spacing and alignment, while supporting in-place editing, as well. The GUI builder is so easy to use and intuitive that it has been used to prototype GUIs live at customer presentations.Write Bug Free CodeThe cost of buggy code increases the longer it remains unfixed. NetBeans provides static analysis tools, especially integration with the widely used FindBugs tool, for identifying and fixing common problems in Java code. In addition, the NetBeans Debugger lets you place breakpoints in your source code, add field watches, step through your code, run into methods, take snapshots and monitor execution as it occurs.The NetBeans Profiler provides expert assistance for optimizing your application's speed and memory usage, and makes it easier to build reliable and scalable Java SE, JavaFX and Java EE applications. NetBeans IDE includes a visual debugger for Java SE applications, letting you debug user interfaces without looking into source code. Take GUI snapshots of your applications and click on user interface elements to jump back into the related source code.CONCEPT OF CLASSESA class is a user defined blueprint or prototype from which objects are created. ?It represents the set of properties or methods that are common to all objects of one type. In general, class declarations can include these components, in order:Modifiers?: A class can be public or has default access (Refer?this?for details).Class name:?The name should begin with a initial letter (capitalized by convention).Superclass(if any):?The name of the class’s parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.Interfaces(if any):?A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface.Body:?The class body?surrounded by braces, { }.Constructors are used for initializing new objects. Fields are variables that provides the state of the class and its objects, and methods are used to implement the behavior of the class and its objects.SUPER AND SUBCLASSESIn Java, it is possible to inherit attributes and methods from one class to another. We group the "inheritance concept" into two categories:subclass?(child) - the class that inherits from another classsuperclass?(parent) - the class being inherited fromTo inherit from a class, use the?extends?keywordNESTED CLASS.Inner class means one class which is a member of another class. There are basically four types of inner classes in java.1) Nested Inner class2) Method Local inner classes3) Anonymous inner classes4) Static nested classesNested Inner class?can access any private instance variable of outer class. Like any other instance variable, we can have access modifier private, protected, public and default modifier.Like class, interface can also be nested and can have access specifiers.class Outer { // Simple nested inner class class Inner { public void show() { System.out.println("In a nested class method"); } } } class Main { public static void main(String[] args) { Outer.Inner in = new Outer().new Inner(); in.show(); } }outputIn a nested class methodEXERCISEInstall NETBEAN 8.2 WTH JDK at home and get familiar with its environment. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download