Javamschn3

375 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

Javamschn3

  1. 1. Syllabus : MSCHN 304 ( JAVA Programming Part I )Section IUnit 1: Introduction to Java TechnologyBrief history of JavaJava Development Kit (JDK)Java CompilerJava InterpreterSource Code & Byte code with “Hello World” ApplicationData types, Variables, ExpressionsBasic Data Types Integers - example, size in bytes Characters - example, size in bytes Floating Points - example, size in bytes Boolean - example, size in bytesVariables Declaration of variable Assignment Statements Scope and lifetime of a variableExpressionsA simple java program illustrating variablesJava Escape Characters, Keywords & OperatorsSpecial characters n, t, Output using system.out.print and system.out.printlnRecognize and use formatting parameters (%b, %c, %d, %f, %s) in format stringsComments /* */ //SeparatorsKeywordsArithmetic Operators : + - * / % ++ —A simple Java program illustrating operatorsOperator precedenceA simple Java program illustrating operator precedenceUnit 2: Selection StatementsControl statementIf StatementRelational Integer operators: > < >= <= == !=Logical operators: && || !Simple Java programs illustrating relational operatorsif … elseswitch … case … defaultSimple Java programs illustrating if … elseif
  2. 2. Simple Java programs illustrating switch … caseConditional boolean operator (? :)Unit 3: Iteration StatementsLoops for while do…whileProgram illustrating for, while and do…while loopNested loopProgram illustrating nested for loopJump statements break; continue;Unit 4: Introducing Classes and MethodsClass and object fundamentalsDeclaring classesDeclaring objectThe “new” operatorA Java program to show class declaration and class object creationIntroducing class variablesA Java program using class variablesIntroducing methods Adding method to a class Adding a method that takes parameters Call by primitive value & call by object reference Method returning valueA Java program using class methods with no parameterA Java program using class methods with parameter and return valueMethod overloadingA Java program to illustrate method overloadingFinal methodsMethod with variable-length argumentNested classObject as a class member variableA Java program to illustrate that Java objects can be used as class membersUnit 5: Constructors & Garbage collectionConcept of Constructor Null constructor Explicit Constructor Parameterized constructorA Java program with explicit constructorsConcept of garbage collectionBehaviors of System.gc and finalizationUnit 6: InheritanceInheritance basics
  3. 3. Advantage of inheritanceDeriving classes – ExtendsA Java program to illustrate class inheritanceUsage of superUsing super to call super class constructorA Java program illustrating “super”Method overridingA Java program showing method overridingAccess modifiers: Private, protected, publicA Java program illustrating the accessibility of member variables and methodsUnit 7: Packages Defining a package Import statement Understanding CLASSPATH A short package exampleAccess protection revised: Package (default) Classes in same package Classes in different package Sub classes in same package Sub classes in different packageConcept of tight encapsulation, loose coupling, and high cohesion in classesAbstract Base Class and MethodsA Java program showing usage of Abstract Base ClassInterfaces Why interfaces Defining interfaces Implementing interfaces A Java program to illustrate interface and its implementationUnit 8: Arrays in JavaConcept of arrayRules for declaring arraysArray indexingAccessing array elementsA Java program to demonstrate an arrayArray initializationOne-dimensional arrayArray as class data memberA Java program to illustrate array as class data memberTwo-dimensional arrayA Java program to demonstrate a two dimensional array.Array of objectsA Java program illustrating array of objectsEnumUnit 9: String HandlingA brief idea about StringDifferences between the String, StringBuilder, and StringBuffer classes
  4. 4. Format or parse dates, numbers, and currency values for a specific locale using java.textPurpose and use of the java.util.Locale classSorting of StringSection IIUnit 10: Exception HandlingException handling fundamentalsRuntime exception, a checked exception, or an errorPredefined exceptionTriggering a predefined exception (ArithmeticException)A Java program which triggers an exception with Command line argumentsHandling the exception try … catch construct and finally clauseA Java program to illustrate try…catch constructMultiple catch clauses and finally clauseA program multiple catch clauses (IndexOutOfBoundsException, NumberFormatException)Usage of throwsUsage of throwA program to demonstrate throwsCreating your own exception subclassesA program using user defined exception.Exceptions thrown by the virtual machineRecognize situations that will result in any of the following being thrown:ArrayIndexOutOfBoundsException, ClassCastException, IllegalArgumentException,IllegalStateException, NullPointerException, NumberFormatException,AssertionError, ExceptionInInitializerError, StackOverflowError or NoClassDefFoundError.Unit 11: Input/Output: Exploring java.ioJava InputStream & OutputStream classesSystem.in & System.out objectA Java program to read keyboard charactersDataInputStream & DataOutputStream classBufferedReader & BufferedWriter classStringBufferInputStream classFile, FileReader & FileWriter classFileInputStream & FileOutputStream classPrintStream classPrintWriter classPrintWriter.format/printf methodsObjectInputStream, ObjectOutputStreamConcept of serializes and/or de-serializes objects and SerializableFormatter and Scanner classesUnit 12: Multithreaded ProgrammingConcept of threadDefine, instantiate, and start new threads Extending Thread Class
  5. 5. Implementing Runnable interfaceExample illustrating multiple threads by Thread class & Runnable interfaceThread schedulingThread.isAlive() & Thread.join() methodFinalizerThread prioritiesA Java program illustrating thread prioritiesSynchronizing with other threadsUse of wait, notify, or notifyAllSection IIIUnit 13: Introducing the AWT: Working with Windows Graphics and TextThe AWT packageWindows fundamentals Component Container Panel Window Frame CanvasFrame and Panel classesWorking with Frame windows Setting frame dimensions Hiding and showing a window Setting a frame titleA Java program illustrating the above subjectsWorking with Frame windows Closing a frame window Displaying information within a windowA Java program illustrating frame windowWorking with Graphics (Using Panel) Drawing lines, rectangles, ellipses, circles, polygonsWorking with color and FontUnit 14: Layout Managers, Menus, Events, Listeners & Adapter ClassesLayout Manager: FlowLayout, BorderLayout, GridLayoutHandling menuA program showing menu and menu barsEvent packageEvent handling with listener interfaces ActionListenerHandling events from multiple sourcesItemListener
  6. 6. WindowsListener, KeyListenerHandling events with Adapter classUnit 15: AppletWhat is Applet?Applets and web pagesLimitation of appletsApplet basicsThe applet classApplet initialisation and termination init(), start(), paint(), stop(), destroy()Example of the simplest possible Java appletRunning applet using applet viewerThe “hello world” applet exampleThe HTML APPLET tag- CODE, ALT, NAME, WIDTH, HEIGHTDrawing graphicsThe scribble appletPassing parameters to appletAn example of getting parametersA Java applet to display an imageGetDocumentBase(), GetCodeBase()
  7. 7. Class-wise Schedule : MScHN-304Unit No. Topics Scheduled Taken Scheduled Taken Th Hr Th Hr Pr Hr Pr Hr Introduction to Java Technology, Data types, Variables,Unit 1 Expressions 2 2Unit 2 Selection Statement 2 2Unit 3 Iteration Statements 2 2Unit 4 Introducing Classes and Methods 2 2Unit 5 Constructors & Garbage collection 2 2Unit 6 Inheritance 2 2Unit 7 Packages 2 2Unit 8 Arrays in Java 2 2Unit 9 String Handling 2 2Unit 10 Exception Handling 2 2Unit 11 Input/Output: Exploring java.io 2 2Unit 12 Multithreaded Programming 2 2 Introducing the AWT: Working with Windows GraphicsUnit 13 and Text 2 2 Layout Managers, Menus, Events, Listeners & AdapterUnit 14 Classes 2 2Unit 15 Applet 2 2Class test (Theory) Unit 1 - 15 2Declaration : All the classes mentioned above have been covered in our batch

×