1. Java is a... language. A. moderate typed B. strogly typed C. weakly typed D. none of these. Answer: B

Size: px
Start display at page:

Download "1. Java is a... language. A. moderate typed B. strogly typed C. weakly typed D. none of these. Answer: B"

Transcription

1 1. Java is a... language. A. moderate typed B. strogly typed C. weakly typed D. none of these 2. How many primitive data types are there in Java? A. 5 B. 6 C. 7 D In Java byte, short, int and long all of these are A. signed B. unsigned C. Both of the above D. None of these 4. Size of int in Java is A. 8 bit B. 16 bit C. 32 bit D. 64 bit 5. The smallest integer type is... and its size is... bits. A. short, 8 B. byte, 8 C. short, 16 D. short, Size of float and double in Java is A. 32 and 64 B. 64 and 64 C. 32 and 32 D. 64 and 32

2 7. Automatic type conversion in Java takes place when A. Two type are compatible and size of destination type is equal of source type. B. Two type are compatible and size of destination type is larger than source type. C. Two type are compatible and size of destination type is shorter than source type. D. All of the above 8. Which of the following automatic type conversion will be possible? A. byte to int B. short to int C. long to int D. int to long 9. The following fraction of code double STATIC = 2.5 ; System.out.println( STATIC ); A. Prints 2.5 B. Raises an exception C. Raises an error as STATIC is used as a variable which is a keyword D. None of these 10. What would be the output of the following fraction of code? int Integer = 34 ; char String = 'S' ; System.out.print( Integer ) ; System.out.print( String ) ; A. Does not compile as Integer and String are B. S API class names. C. 34 D. 34 S 11. The following program: public class Test{ static boolean is OK; public static void main(string args[]){system.out.print(is OK); } } A. Prints true B. Prints false

3 C. Will not compile as boolean is not initialized D. Will not compile as boolean can never be static 12. In Java, the word true is... A. A Boolean literal B. A Java keyword C. Same as value 0 D. Same as value What will the output of the following program? public class Test{ public static void main(string args[]){float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); } } A. 0 B. 1 C. 2 D What is the output for the below code? public class Test{public static void main(string[] args){int i = 010; int j = 07;System.out.println(i); System.out.println(j); } } A. 7 8 B. 8 7 C. 9 8 D. None 15. What will be output of following program? public class Test{public static void main(string[] args){byte b=127; b++; b++; System.out.println(b); } } A. 127 B C. 129 D Which class cannot be subclassed (or extended) in java? A. Final class B. abstract class

4 C. parent class D. None of above 17. Why we use array as a parameter of main method A. Can store multiple values B. It is syntax C. Both of above D. None of above 18. Suspend thread can be revived by using A. yield() method B. Suspend() method C. start() method D. resume() method 19. Runnable is A. Interface B. Class C. Variable D. Method 20. Which collection class associates values witch keys, and orders the keys according to their natural order A. java.util.linkedlist B. java.util.treemap C. java.util.sortedset D. java.util.hashset 21. Which method is used to perform DML statements in JDBC A. executeupdate() B. executequery() C. execute() D. None of above

5 22. Which of the following below are valid isolation levels in J2EE A. TRANSACTION_READ_UNCOMMITTED B. TRANSACTION_SERIALIZABLE C. Only A D. Both A and B 23. Which metrhods are utilized to control the access to an object in multi threaded programming A. Synchronized methods B. Asynchronized methods C. Serialized methods D. None of above 24. Program which executes applet is known as A. JVM B. virtual machine C. applet engine D. None of above 25. Which statement is static and synchronized in JDBC API A. getconnection() B. executequery() C. preparecall() D. executeupdate() 26. The JDBC-ODBC bridge is A. Singlethreaded B. Multithreaded C. Both of above D. None of above 27. All raw data types should be read and uploaded to the database as an array of A. int B. byte C. char D. bollean

6 28. The class java.sql.timestamp is associated with A. java.util.date B. java.util.time C. java.sql.time D. None of above 29. Which of the following statements about arrays is syntactically wrong A. arrayname[] p = new arrayname[5]; B. arrayname p[][] = new arrayname[2][]; C. arrayname[] p []; D. arrayname p[5]; 30. Converting a primitive type data into its corresponding wrapper class object instance is called A. boxing B. wrapping C. autoboxing D. instantiation 31. Package of drawstring() method is A. java.awt B. javax.swing C. java.applet D. java.io 32. Which method executes only once A. stop() method B. start() method C. init() method D. destroy() method

7 33. Object which can store group of other objects is called A. Package B. Wrapper C. Java object D. Collection object 34. All collection classes are available in A. java.util package B. java.io package C. java.lang package D. java.awt package 35. Thread class is available in A. java.lang package B. java.util package C. java.awt package D. java.io package 36. Minimum threads in a program are A. 0 B. 1 C. 2 D JIT meaning A. just in time B. java in time C. join in time D. none of above 38. After the compilation of the java source code, which file is created by the JVM A..class B..doc C..java D..cdr

8 39. pow () is associated with which class A. Input stream class B. Object class C. Math class D. None of above 40. x=x+1 is equivalent to A. x++ B. ++x C. x=x-1 D. None of these 41. If method have same name as class name and method don t have any return type then it is known as A. Constructor B. Destructors C. Variable D. Object 42. Methods that have same name, but different Parameter list and different definition known as A. Overriding B. Overloading C. Constructor D. none of these 43. Inheritance means A. Sub class create object of super class B. Sub class extends Base class C. Sub class extends super class D. All of the above 44. Which type of inheritance is not supported by java

9 A. Single B. Mulilevel C. Hirarchical D. Multiple 45. String is the predefined A. Object B. Variable C. Class D. Method 46. Super is the predefined A. Method B. Keyword C. Keyword and Method D. None of above 47. Execution of the program is always begins with A. Main method B. parent class C. default package D. class contain main method 48. In java, gc() method is available in which package A. java.io package B. java.lang package C. java.awt package D. java.util package 49. JAR file contains the compressed version of A..java file B..jsp file C..class file D. None of above

10 50. Process of creating exact copy of the existing object is called A. overloading B. overriding C. cloning D. coping 51. Which is the predefined package A. Lang package B. util package C. io package D. All of above 52. Java intermediate code is known as A. Byte code B. First code C. Mid code D. None of above 53. Which command is used for interpretation of java program A. Java B. javap C. javac D. none of above 54. What is meaning of jar A. java array B. java architecture C. java archived D. none of these 55. Which of the following command is used to compile the Java program A. java B. javac C. javap D. none of these

11 56. What do you mean by javap A. java compiler B. java debugger C. java Interpreter D. java Disassemble 57. What is jdb A. java Disassemble B. java Interpreter C. java compiler D. java debugger 58. Java is known as stage language A. 1 B. 2 C. 3 D Which driver is called as thin-driver in JDBC A. Type-1 driver B. Type-2 driver C. Type-3 driver D. Type-4 driver 60. How many transaction isolation levels are defined in java.sql.connection interface A. 6 B. 2 C. 5 D. 3

12 61. Which method of java is invoked by JVM to reclaim the inaccessible memory location A. reclaim() method B. finalize() method C. final() method D. both b and c 62. allows java code to run in the JVM to call and be called by native applications A. JNI B. FJI C. NJI D. JFI 63. Interfaces helps in which type of inheritance A. Multiple inheritance B. Multilevel inheritance C. Hierarchical inheritance D. None of above 64. Which method of the Applet class displays the result of applet code on screen A. paint() method B. main() method C. run() method D. drawstring() method 65. Which command disassembles a class file A. javacmd B. javaamd C. javap D. java 66. In which we clone the object and their constituent parts A. Deep cloning B. Shallow cloning C. Both of above D. None of above

13 67. Which driver is efficient and always preferable for using JDBC applications A. Type-1 driver B. Type-2 driver C. Type-3 driver D. Type-4 driver 68. Executable applet is A..class file B..java file C..java html D..applet file 69. Which keyword is used while using interface A. throw B. throws C. extend D. implements 70. Which keyword represents object of the present class A. this B. static C. package D. interface 71. Which method can't be overidden A. println B. final C. super D. static

14 72. Hot java is A. Web browser B. Java environment C. System software D. IDE 73. javah stands for A. java dissasamebler B. java header file C. java interpreter D. java compiler 74. Main method parameter has which type of data type A. int B. char C. string D. double 75. How many keywords are available in java A. 24 B. 48 C. 96 D Smallest individual unit in java program is known as A. token B. string C. literal D. operator 77. Which among following classes is not part of Java's collection framework A. Stack B. Maps C. Queue D. Array

15 78. Suppose a class has public visibility. In this class we define a protected method. Which of the following statements is correct? A. From within protected methods you do not have access to public methods. B. This method is only accessible from inside the class itself and from inside all subclasses. C. In a class, you cannot declare methods with ad. This method is accessible from within the lower visibility than the visibility of the class in which it is defined. class itself and from within all classes defined in the same package as the class itself. 79. The object is created with "new" keyword A. At Compile-time B. At run-time C. Depends on the code D. None of these 80. Which statements are most accurate regarding the following classes? class A{private int i; protected int j; } class B extends A{ private int k; protected int m; } A. An object of B contains data fields j, k, m B. An object of B contains data fields k, m C. An object of B contains data fields j, m D. An object of B contains data fields i, j, k, m 81. A package is a collection of A. Classes and Interfaces B. Classes C. Editing tools D. Editing tools and Interfaces 82. A method within a class is only accessible by classes that are defined within the same package as the class of the method. Which one of the following is used to enforce such restriction?

16 A. Declare the method with the keyword public. B. Declare the method with the keyword private. C. Do not declare the method with any accessibility modifiers. D. Declare the method with the keyword public and private. 83. Choose the correct statement public class Circle{ private double radius; public Circle(double radius){ radius = radius; } } A. The program has a compilation error because we cannot assign radius to radius. B. The program has a compilation error because it does not have a main method. C. The program does not compile because Circle does not have a default constructor. D. The program will compile, but we cannot create an object of Circle with a specified radius. The object will always have radius Choose the correct statement : Restriction on static methods are- A. They cannot refer this or super in any way. B. They must only access static data. C. They can only call other static methods. D. All of the above 85. Name the keyword that makes a variable belong to a class, rather than being defined for each instance of the class. A. abstract B. static C. volatile D. final 86. In Java arrays are A. objects B. object references C. primitive data type D. None of the above 87. Which one of the following is a valid statement?

17 A. char[] c = new char&l B. char[] c = new char&l C. char[] c = new char&l D. char[] c = new char&l 88. What is the result of compiling and running the following code? public class Test{ public static void main(string[] args){ int[] a = new int[0]; System.out.print(a.length); } } A. 0 B. 1 C. compile error D. None of the above 89. What will be the output? public class Test{ public static void main(string[] args){ int[] x = new int[3]; System.out.println("x[0] is " + x[0]); } } A. The program runs fine and displays x[0] is 0 B. The program has a runtime error because the array element x[0] is not defined C. The program has a runtime error because the array elements are not initialized D. The program has a compile error because the size of the array wasn't specified when declaring the array 90. What is output of the following code: public class Test{public static void main(string[] args){ int[] x = {120, 200, 016 }; for(int i = 0; i < x.length; i++)system.out.print(x[i] + " "); } } A B C D. 016 is a compile error. It should be written as What will be the output? public class Test{ public static void main(string[] arg{ int[] a = new int[4]; a[1] = 1; a = new int[2]; System.out.println("a[1] is " + a[1]); } } A. a[1] is 0 B. a[1] is 1 C. a[1] is 2 D. Compile error

18 92. When you pass an array to a method, the method receives. A. The length of the array. B. The reference of the array. C. A copy of the array. D. A copy of the first element. 93. Which will legally declare, construct, and initialize an array? A. int [] mylist = { B. int [] mylist = (5, 8, 2); C. int mylist [] [] = {4,9,7,0}; D. int mylist [] = {4, 3, 7}; 94. What is the value of a[1] after the following code is executed? int[] a = {0, 2, 4, 1, 3}; for(int i = 0; i < a.length; i++) a[i] = a[(a[i] + 3) % a.length]; A. 0 B. 1 C. 2 D The output of the following fraction of code is public class Test{ public static void main(string args[]){ String s1 = new String("Hello"); String s2 = new String("Hellow"); System.out.printl A. Hellow B. Hello C. Compilation error D. None of these 96. Output : public class Test{ public static void main(string args[]){ String x = "hellow"; int y = 9; System.out.println(x += y); } } A. hellow9 B. 9hellow C. Compilation error D. None of these 97. tostring() method is defined in

19 A. java.lang.util B. java.lang.object C. java.lang.string D. None of these 98. The String method compareto() returns A. True B. False C. an int value D What will be the output? String str1 = "abcde"; System.out.println(str1.substring(1, 3)); A. abc B. ab C. bc D. cba 100. What is the output of the following println statement? String str1 = "Hellow"; System.out.println(str1.indexOf('t')); A. 1 B. -1 C. 2 D. -2

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA 1. JIT meaning a. java in time b. just in time c. join in time d. none of above CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA 2. After the compilation of the java source code, which file is created

More information

1 Shyam sir JAVA Notes

1 Shyam sir JAVA Notes 1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write

More information

Selected Questions from by Nageshwara Rao

Selected Questions from  by Nageshwara Rao Selected Questions from http://way2java.com by Nageshwara Rao Swaminathan J Amrita University swaminathanj@am.amrita.edu November 24, 2016 Swaminathan J (Amrita University) way2java.com (Nageshwara Rao)

More information

Java Intro 3. Java Intro 3. Class Libraries and the Java API. Outline

Java Intro 3. Java Intro 3. Class Libraries and the Java API. Outline Java Intro 3 9/7/2007 1 Java Intro 3 Outline Java API Packages Access Rules, Class Visibility Strings as Objects Wrapper classes Static Attributes & Methods Hello World details 9/7/2007 2 Class Libraries

More information

Core JAVA Training Syllabus FEE: RS. 8000/-

Core JAVA Training Syllabus FEE: RS. 8000/- About JAVA Java is a high-level programming language, developed by James Gosling at Sun Microsystems as a core component of the Java platform. Java follows the "write once, run anywhere" concept, as it

More information

Chapter 1 Introduction to Java

Chapter 1 Introduction to Java What is Java? Chapter 1 Introduction to Java Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows,

More information

OBJECT ORIENTED PROGRAMMING TYm. Allotted : 3 Hours Full Marks: 70

OBJECT ORIENTED PROGRAMMING TYm. Allotted : 3 Hours Full Marks: 70 I,.. CI/. T.cH/C8E/ODD SEM/SEM-5/CS-504D/2016-17... AiIIIII "-AmI u...iir e~ IlAULAKA ABUL KALAM AZAD UNIVERSITY TECHNOLOGY,~TBENGAL Paper Code: CS-504D OF OBJECT ORIENTED PROGRAMMING TYm. Allotted : 3

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

S.E. Sem. III [CMPN] Object Oriented Programming Methodology

S.E. Sem. III [CMPN] Object Oriented Programming Methodology S.E. Sem. III [CMPN] Object Oriented Programming Methodology Time : 3 Hrs.] Prelim Question Paper Solution [Marks : 80 Q.1(a) Write a program to calculate GCD of two numbers in java. [5] (A) import java.util.*;

More information

Java Primer. CITS2200 Data Structures and Algorithms. Topic 2

Java Primer. CITS2200 Data Structures and Algorithms. Topic 2 CITS2200 Data Structures and Algorithms Topic 2 Java Primer Review of Java basics Primitive vs Reference Types Classes and Objects Class Hierarchies Interfaces Exceptions Reading: Lambert and Osborne,

More information

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE

More information

CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1

CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1 P a g e 1 CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1 Q1 Describe some Characteristics/Advantages of Java Language? (P#12, 13, 14) 1. Java

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

The Sun s Java Certification and its Possible Role in the Joint Teaching Material

The Sun s Java Certification and its Possible Role in the Joint Teaching Material The Sun s Java Certification and its Possible Role in the Joint Teaching Material Nataša Ibrajter Faculty of Science Department of Mathematics and Informatics Novi Sad 1 Contents Kinds of Sun Certified

More information

Computer Programming, I. Laboratory Manual. Final Exam Solution

Computer Programming, I. Laboratory Manual. Final Exam Solution Think Twice Code Once The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2005 Khaleel I. Shaheen Computer Programming, I Laboratory Manual Final Exam Solution

More information

STRUCTURING OF PROGRAM

STRUCTURING OF PROGRAM Unit III MULTIPLE CHOICE QUESTIONS 1. Which of the following is the functionality of Data Abstraction? (a) Reduce Complexity (c) Parallelism Unit III 3.1 (b) Binds together code and data (d) None of the

More information

Class Libraries and Packages

Class Libraries and Packages Class Libraries and Packages Wolfgang Schreiner Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria Wolfgang.Schreiner@risc.jku.at http://www.risc.jku.at Wolfgang

More information

I pledge by honor that I will not discuss this exam with anyone until my instructor reviews the exam in the class.

I pledge by honor that I will not discuss this exam with anyone until my instructor reviews the exam in the class. Name: Covers Chapters 1-3 50 mins CSCI 1301 Introduction to Programming Armstrong Atlantic State University Instructor: Dr. Y. Daniel Liang I pledge by honor that I will not discuss this exam with anyone

More information

Class, Variable, Constructor, Object, Method Questions

Class, Variable, Constructor, Object, Method Questions Class, Variable, Constructor, Object, Method Questions http://www.wideskills.com/java-interview-questions/java-classes-andobjects-interview-questions https://www.careerride.com/java-objects-classes-methods.aspx

More information

CS/B.TECH/CSE(OLD)/SEM-6/CS-605/2012 OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

CS/B.TECH/CSE(OLD)/SEM-6/CS-605/2012 OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 CS/B.TECH/CSE(OLD)/SEM-6/CS-605/2012 2012 OBJECT ORIENTED PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers

More information

1.Which four options describe the correct default values for array elements of the types indicated?

1.Which four options describe the correct default values for array elements of the types indicated? 1.Which four options describe the correct default values for array elements of the types indicated? 1. int -> 0 2. String -> "null" 3. Dog -> null 4. char -> '\u0000' 5. float -> 0.0f 6. boolean -> true

More information

An overview of Java, Data types and variables

An overview of Java, Data types and variables An overview of Java, Data types and variables Lecture 2 from (UNIT IV) Prepared by Mrs. K.M. Sanghavi 1 2 Hello World // HelloWorld.java: Hello World program import java.lang.*; class HelloWorld { public

More information

Methods (Deitel chapter 6)

Methods (Deitel chapter 6) Methods (Deitel chapter 6) 1 Plan 2 Introduction Program Modules in Java Math-Class Methods Method Declarations Argument Promotion Java API Packages Random-Number Generation Scope of Declarations Methods

More information

Methods (Deitel chapter 6)

Methods (Deitel chapter 6) 1 Plan 2 Methods (Deitel chapter ) Introduction Program Modules in Java Math-Class Methods Method Declarations Argument Promotion Java API Packages Random-Number Generation Scope of Declarations Methods

More information

Name of subject: JAVA PROGRAMMING Subject code: Semester: V ASSIGNMENT 1

Name of subject: JAVA PROGRAMMING Subject code: Semester: V ASSIGNMENT 1 Name of subject: JAVA PROGRAMMING Subject code: 17515 Semester: V ASSIGNMENT 1 3 Marks Introduction to Java (16 Marks) 1. Write all primitive data types available in java with their storage size in bytes.

More information

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance Contents Topic 04 - Inheritance I. Classes, Superclasses, and Subclasses - Inheritance Hierarchies Controlling Access to Members (public, no modifier, private, protected) Calling constructors of superclass

More information

Objective Questions. BCA Part III Paper XIX (Java Programming) page 1 of 5

Objective Questions. BCA Part III Paper XIX (Java Programming) page 1 of 5 Objective Questions BCA Part III page 1 of 5 1. Java is purely object oriented and provides - a. Abstraction, inheritance b. Encapsulation, polymorphism c. Abstraction, polymorphism d. All of the above

More information

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question) CS/B.TECH/CSE(New)/SEM-5/CS-504D/2013-14 2013 OBJECT ORIENTED PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers

More information

CSCE3193: Programming Paradigms

CSCE3193: Programming Paradigms CSCE3193: Programming Paradigms Nilanjan Banerjee University of Arkansas Fayetteville, AR nilanb@uark.edu http://www.csce.uark.edu/~nilanb/3193/s10/ Programming Paradigms 1 Java Packages Application programmer

More information

15CS45 : OBJECT ORIENTED CONCEPTS

15CS45 : OBJECT ORIENTED CONCEPTS 15CS45 : OBJECT ORIENTED CONCEPTS QUESTION BANK: What do you know about Java? What are the supported platforms by Java Programming Language? List any five features of Java? Why is Java Architectural Neutral?

More information

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring Java Outline Java Models for variables Types and type checking, type safety Interpretation vs. compilation Reasoning about code CSCI 2600 Spring 2017 2 Java Java is a successor to a number of languages,

More information

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS Core Java SYLLABUS COVERAGE Introduction. OOPS Package Exception Handling. Multithreading Applet, AWT, Event Handling Using NetBean, Ecllipse. Input Output Streams, Serialization Networking Collection

More information

Self-test Java Programming

Self-test Java Programming Self-test Java Programming Document: e0883test.fm 16 January 2018 ABIS Training & Consulting Diestsevest 32 / 4b B-3000 Leuven Belgium TRAINING & CONSULTING INTRODUCTION TO THE SELF-TEST JAVA PROGRAMMING

More information

Java Professional Certificate Day 1- Bridge Session

Java Professional Certificate Day 1- Bridge Session Java Professional Certificate Day 1- Bridge Session 1 Java - An Introduction Basic Features and Concepts Java - The new programming language from Sun Microsystems Java -Allows anyone to publish a web page

More information

CS506 Web Design & Development Final Term Solved MCQs with Reference

CS506 Web Design & Development Final Term Solved MCQs with Reference with Reference I am student in MCS (Virtual University of Pakistan). All the MCQs are solved by me. I followed the Moaaz pattern in Writing and Layout this document. Because many students are familiar

More information

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started Application Development in JAVA Duration Lecture: Specialization x Hours Core Java (J2SE) & Advance Java (J2EE) Detailed Module Part I: Core Java (J2SE) Getting Started What is Java all about? Features

More information

Chapter 1: Introduction to Computers, Programs, and Java

Chapter 1: Introduction to Computers, Programs, and Java Chapter 1: Introduction to Computers, Programs, and Java 1. Q: When you compile your program, you receive an error as follows: 2. 3. %javac Welcome.java 4. javac not found 5. 6. What is wrong? 7. A: Two

More information

Class definition. complete definition. public public class abstract no instance can be created final class cannot be extended

Class definition. complete definition. public public class abstract no instance can be created final class cannot be extended JAVA Classes Class definition complete definition [public] [abstract] [final] class Name [extends Parent] [impelements ListOfInterfaces] {... // class body public public class abstract no instance can

More information

CS 113 PRACTICE FINAL

CS 113 PRACTICE FINAL CS 113 PRACTICE FINAL There are 13 questions on this test. The value of each question is: 1-10 multiple choice (4 pt) 11-13 coding problems (20 pt) You may get partial credit for questions 11-13. If you

More information

Questions Answer Key Questions Answer Key Questions Answer Key

Questions Answer Key Questions Answer Key Questions Answer Key Benha University Term: 2 nd (2013/2014) Class: 2 nd Year Students Subject: Object Oriented Programming Faculty of Computers & Informatics Date: 26/4/2014 Time: 1 hours Exam: Mid-Term (A) Name:. Status:

More information

The Java programming environment. The Java programming environment. Java: A tiny intro. Java features

The Java programming environment. The Java programming environment. Java: A tiny intro. Java features The Java programming environment Cleaned up version of C++: no header files, macros, pointers and references, unions, structures, operator overloading, virtual base classes, templates, etc. Object-orientation:

More information

3. Convert 2E from hexadecimal to decimal. 4. Convert from binary to hexadecimal

3. Convert 2E from hexadecimal to decimal. 4. Convert from binary to hexadecimal APCS A Midterm Review You will have a copy of the one page Java Quick Reference sheet. This is the same reference that will be available to you when you take the AP Computer Science exam. 1. n bits can

More information

JAVA MOCK TEST JAVA MOCK TEST III

JAVA MOCK TEST JAVA MOCK TEST III http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

Java Bytecode (binary file)

Java Bytecode (binary file) Java is Compiled Unlike Python, which is an interpreted langauge, Java code is compiled. In Java, a compiler reads in a Java source file (the code that we write), and it translates that code into bytecode.

More information

Program Fundamentals

Program Fundamentals Program Fundamentals /* HelloWorld.java * The classic Hello, world! program */ class HelloWorld { public static void main (String[ ] args) { System.out.println( Hello, world! ); } } /* HelloWorld.java

More information

Object Oriented Programming with Java. Unit-1

Object Oriented Programming with Java. Unit-1 CEB430 Object Oriented Programming with Java Unit-1 PART A 1. Define Object Oriented Programming. 2. Define Objects. 3. What are the features of Object oriented programming. 4. Define Encapsulation and

More information

Interfaces. An interface forms a contract between the object and the outside world.

Interfaces. An interface forms a contract between the object and the outside world. Interfaces An interface forms a contract between the object and the outside world. For example, the buttons on the television set are the interface between you and the electrical wiring on the other side

More information

SCHEME OF COURSE WORK

SCHEME OF COURSE WORK SCHEME OF COURSE WORK Course Details: Course Title Object oriented programming through JAVA Course Code 15CT1109 L T P C : 3 0 0 3 Program: B.Tech. Specialization: Information Technology Semester IV Prerequisites

More information

String is one of mostly used Object in Java. And this is the reason why String has unique handling in Java(String Pool). The String class represents

String is one of mostly used Object in Java. And this is the reason why String has unique handling in Java(String Pool). The String class represents String is one of mostly used Object in Java. And this is the reason why String has unique handling in Java(String Pool). The String class represents character strings. All string literals in Java programs,

More information

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2 CS321 Languages and Compiler Design I Winter 2012 Lecture 2 1 A (RE-)INTRODUCTION TO JAVA FOR C++/C PROGRAMMERS Why Java? Developed by Sun Microsystems (now Oracle) beginning in 1995. Conceived as a better,

More information

Character Stream : It provides a convenient means for handling input and output of characters.

Character Stream : It provides a convenient means for handling input and output of characters. Be Perfect, Do Perfect, Live Perfect 1 1. What is the meaning of public static void main(string args[])? public keyword is an access modifier which represents visibility, it means it is visible to all.

More information

Crash Course in Java. Why Java? Java notes for C++ programmers. Network Programming in Java is very different than in C/C++

Crash Course in Java. Why Java? Java notes for C++ programmers. Network Programming in Java is very different than in C/C++ Crash Course in Java Netprog: Java Intro 1 Why Java? Network Programming in Java is very different than in C/C++ much more language support error handling no pointers! (garbage collection) Threads are

More information

Assignment No 1. Sanjivani Rural Education Society s KBP Polytechnic, Kopargaon. HOD [ Prof. A. R. Mirikar ] Subject Teacher [Prof. H.E.

Assignment No 1. Sanjivani Rural Education Society s KBP Polytechnic, Kopargaon. HOD [ Prof. A. R. Mirikar ] Subject Teacher [Prof. H.E. Year: 205-6 CHAPTER : Introduction to the Abstract Windowing Toolkit (AWT) and Swings (24 Marks) Q. Which of the following class is derived from the container class? (a) Component (b) Panel (c) MenuComponent

More information

CMSC 331 Second Midterm Exam

CMSC 331 Second Midterm Exam 1 20/ 2 80/ 331 First Midterm Exam 11 November 2003 3 20/ 4 40/ 5 10/ CMSC 331 Second Midterm Exam 6 15/ 7 15/ Name: Student ID#: 200/ You will have seventy-five (75) minutes to complete this closed book

More information

Introduction to Java

Introduction to Java Introduction to Java Module 1: Getting started, Java Basics 22/01/2010 Prepared by Chris Panayiotou for EPL 233 1 Lab Objectives o Objective: Learn how to write, compile and execute HelloWorld.java Learn

More information

Objects, Distribution, and the Internet. Update on Java. Introduction, fundamentals and basic concepts. Outline

Objects, Distribution, and the Internet. Update on Java. Introduction, fundamentals and basic concepts. Outline Objects, Distribution, and the Internet Update on Java CIMPA INRIA UNESCO School Mérida,Universidad de los Andes (Venezuela) January 7-18, 2002 Richard Grin Richard.Grin@unice.fr University de Nice - Sophia

More information

Modern Programming Languages. Lecture Java Programming Language. An Introduction

Modern Programming Languages. Lecture Java Programming Language. An Introduction Modern Programming Languages Lecture 27-30 Java Programming Language An Introduction 107 Java was developed at Sun in the early 1990s and is based on C++. It looks very similar to C++ but it is significantly

More information

Lab5. Wooseok Kim

Lab5. Wooseok Kim Lab5 Wooseok Kim wkim3@albany.edu www.cs.albany.edu/~wooseok/201 Question Answer Points 1 A or B 8 2 A 8 3 D 8 4 20 5 for class 10 for main 5 points for output 5 D or E 8 6 B 8 7 1 15 8 D 8 9 C 8 10 B

More information

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries 1 CONTENTS 1. Introduction to Java 2. Holding Data 3. Controllin g the f l o w 4. Object Oriented Programming Concepts 5. Inheritance & Packaging 6. Handling Error/Exceptions 7. Handling Strings 8. Threads

More information

Brief Summary of the Chapter: CHAPTER-6 MORE ABOUT CLASSES AND LIBRARIES In this chapter the way access of members of a class i.e. about access specifier will be discuss. Java include predefined classes

More information

Outline. Overview. Control statements. Classes and methods. history and advantage how to: program, compile and execute 8 data types 3 types of errors

Outline. Overview. Control statements. Classes and methods. history and advantage how to: program, compile and execute 8 data types 3 types of errors Outline Overview history and advantage how to: program, compile and execute 8 data types 3 types of errors Control statements Selection and repetition statements Classes and methods methods... 2 Oak A

More information

Interfaces (1/2) An interface forms a contract between the object and the outside world.

Interfaces (1/2) An interface forms a contract between the object and the outside world. Interfaces (1/2) An interface forms a contract between the object and the outside world. For example, the buttons on remote controls for some machine. As you can see, an interface is a reference type,

More information

CS260 Intro to Java & Android 03.Java Language Basics

CS260 Intro to Java & Android 03.Java Language Basics 03.Java Language Basics http://www.tutorialspoint.com/java/index.htm CS260 - Intro to Java & Android 1 What is the distinction between fields and variables? Java has the following kinds of variables: Instance

More information

5. PACKAGES AND INTERFACES

5. PACKAGES AND INTERFACES 5. PACKAGES AND INTERFACES JAVA PROGRAMMING(2350703) Packages: A is a group of classes and interfaces. Package can be categorized in two form: built-in such as java, lang, awt, javax, swing, net, io, util,

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

Fundamentals of Object Oriented Programming

Fundamentals of Object Oriented Programming INDIAN INSTITUTE OF TECHNOLOGY ROORKEE Fundamentals of Object Oriented Programming CSN- 103 Dr. R. Balasubramanian Associate Professor Department of Computer Science and Engineering Indian Institute of

More information

Java Identifiers, Data Types & Variables

Java Identifiers, Data Types & Variables Java Identifiers, Data Types & Variables 1. Java Identifiers: Identifiers are name given to a class, variable or a method. public class TestingShastra { //TestingShastra is an identifier for class char

More information

Points To Remember for SCJP

Points To Remember for SCJP Points To Remember for SCJP www.techfaq360.com The datatype in a switch statement must be convertible to int, i.e., only byte, short, char and int can be used in a switch statement, and the range of the

More information

5/23/2015. Core Java Syllabus. VikRam ShaRma

5/23/2015. Core Java Syllabus. VikRam ShaRma 5/23/2015 Core Java Syllabus VikRam ShaRma Basic Concepts of Core Java 1 Introduction to Java 1.1 Need of java i.e. History 1.2 What is java? 1.3 Java Buzzwords 1.4 JDK JRE JVM JIT - Java Compiler 1.5

More information

Brief Summary of Java

Brief Summary of Java Brief Summary of Java Java programs are compiled into an intermediate format, known as bytecode, and then run through an interpreter that executes in a Java Virtual Machine (JVM). The basic syntax of Java

More information

Lab5. Wooseok Kim

Lab5. Wooseok Kim Lab5 Wooseok Kim wkim3@albany.edu www.cs.albany.edu/~wooseok/201 Question Answer Points 1 A 8 2 A 8 3 E 8 4 D 8 5 20 5 for class 10 for main 5 points for output 6 A 8 7 B 8 8 0 15 9 D 8 10 B 8 Question

More information

Getting Started in Java. Bill Pugh Dept. of Computer Science Univ. of Maryland, College Park

Getting Started in Java. Bill Pugh Dept. of Computer Science Univ. of Maryland, College Park Getting Started in Java Bill Pugh Dept. of Computer Science Univ. of Maryland, College Park Hello, World In HelloWorld.java public class HelloWorld { public static void main(string [] args) { System.out.println(

More information

F I N A L E X A M I N A T I O N

F I N A L E X A M I N A T I O N Faculty Of Computer Studies M257 Putting Java to Work F I N A L E X A M I N A T I O N Number of Exam Pages: (including this cover sheet( Spring 2011 April 4, 2011 ( 5 ) Time Allowed: ( 1.5 ) Hours Student

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p.

A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p. A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p. 9 Classes and Objects p. 11 Creating Objects p. 12 Static or

More information

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Atelier Java - J1. Marwan Burelle.  EPITA Première Année Cycle Ingénieur. marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Plan 1 2 Plan 3 4 Plan 1 2 3 4 A Bit of History JAVA was created in 1991 by James Gosling of SUN. The first public implementation (v1.0) in 1995.

More information

Unit 4 - Inheritance, Packages & Interfaces

Unit 4 - Inheritance, Packages & Interfaces Inheritance Inheritance is the process, by which class can acquire the properties and methods of its parent class. The mechanism of deriving a new child class from an old parent class is called inheritance.

More information

Goals. Java - An Introduction. Java is Compiled and Interpreted. Architecture Neutral & Portable. Compiled Languages. Introduction to Java

Goals. Java - An Introduction. Java is Compiled and Interpreted. Architecture Neutral & Portable. Compiled Languages. Introduction to Java Goals Understand the basics of Java. Introduction to Java Write simple Java Programs. 1 2 Java - An Introduction Java is Compiled and Interpreted Java - The programming language from Sun Microsystems Programmer

More information

Answer1. Features of Java

Answer1. Features of Java Govt Engineering College Ajmer, Rajasthan Mid Term I (2017-18) Subject: PJ Class: 6 th Sem(IT) M.M:10 Time: 1 hr Q1) Explain the features of java and how java is different from C++. [2] Q2) Explain operators

More information

Getting started with Java

Getting started with Java Getting started with Java Magic Lines public class MagicLines { public static void main(string[] args) { } } Comments Comments are lines in your code that get ignored during execution. Good for leaving

More information

PROGRAMMING FUNDAMENTALS

PROGRAMMING FUNDAMENTALS PROGRAMMING FUNDAMENTALS Q1. Name any two Object Oriented Programming languages? Q2. Why is java called a platform independent language? Q3. Elaborate the java Compilation process. Q4. Why do we write

More information

Administrivia. Java Review. Objects and Variables. Demo. Example. Example: Assignments

Administrivia. Java Review. Objects and Variables. Demo. Example. Example: Assignments CMSC433, Spring 2004 Programming Language Technology and Paradigms Java Review Jeff Foster Feburary 3, 2004 Administrivia Reading: Liskov, ch 4, optional Eckel, ch 8, 9 Project 1 posted Part 2 was revised

More information

Another IS-A Relationship

Another IS-A Relationship Another IS-A Relationship Not all classes share a vertical relationship. Instead, some are supposed to perform the specific methods without a vertical relationship. Consider the class Bird inherited from

More information

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Language Features. 1. The primitive types int, double, and boolean are part of the AP Language Features 1. The primitive types int, double, and boolean are part of the AP short, long, byte, char, and float are not in the subset. In particular, students need not be aware that strings are

More information

Java Programming. MSc Induction Tutorials Stefan Stafrace PhD Student Department of Computing

Java Programming. MSc Induction Tutorials Stefan Stafrace PhD Student Department of Computing Java Programming MSc Induction Tutorials 2011 Stefan Stafrace PhD Student Department of Computing s.stafrace@surrey.ac.uk 1 Tutorial Objectives This is an example based tutorial for students who want to

More information

Computational Expression

Computational Expression Computational Expression Variables, Primitive Data Types, Expressions Janyl Jumadinova 28-30 January, 2019 Janyl Jumadinova Computational Expression 28-30 January, 2019 1 / 17 Variables Variable is a name

More information

엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED

엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED 엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED Outline - Questionnaire Results - Java Overview - Java Examples

More information

Java Programming. Manuel Oriol, March 22nd, 2007

Java Programming. Manuel Oriol, March 22nd, 2007 Java Programming Manuel Oriol, March 22nd, 2007 Goal Teach Java to proficient programmers 2 Roadmap Java Basics Eclipse Java GUI Threads and synchronization Class loading and reflection Java Virtual Machines

More information

Java Primer. CITS2200 Data Structures and Algorithms. Topic 0

Java Primer. CITS2200 Data Structures and Algorithms. Topic 0 CITS2200 Data Structures and Algorithms Topic 0 Java Primer Review of Java basics Primitive vs Reference Types Classes and Objects Class Hierarchies and Interfaces Exceptions Generics Reading: Lambert

More information

An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a

An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a CBOP3203 An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page. When you use a Java technology-enabled

More information

CS 251 Intermediate Programming Methods and Classes

CS 251 Intermediate Programming Methods and Classes CS 251 Intermediate Programming Methods and Classes Brooke Chenoweth University of New Mexico Fall 2018 Methods An operation that can be performed on an object Has return type and parameters Method with

More information

CS 251 Intermediate Programming Methods and More

CS 251 Intermediate Programming Methods and More CS 251 Intermediate Programming Methods and More Brooke Chenoweth University of New Mexico Spring 2018 Methods An operation that can be performed on an object Has return type and parameters Method with

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction OGIES 6/7 A- Core Java The Core Java segment deals with the basics of Java. It is designed keeping in mind the basics of Java Programming Language that will help new students to understand the Java language,

More information

WOSO Source Code (Java)

WOSO Source Code (Java) WOSO 2017 - Source Code (Java) Q 1 - Which of the following is false about String? A. String is immutable. B. String can be created using new operator. C. String is a primary data type. D. None of the

More information

20 Most Important Java Programming Interview Questions. Powered by

20 Most Important Java Programming Interview Questions. Powered by 20 Most Important Java Programming Interview Questions Powered by 1. What's the difference between an interface and an abstract class? An abstract class is a class that is only partially implemented by

More information

Selected Java Topics

Selected Java Topics Selected Java Topics Introduction Basic Types, Objects and Pointers Modifiers Abstract Classes and Interfaces Exceptions and Runtime Exceptions Static Variables and Static Methods Type Safe Constants Swings

More information

CS Internet programming Unit- I Part - A 1 Define Java. 2. What is a Class? 3. What is an Object? 4. What is an Instance?

CS Internet programming Unit- I Part - A 1 Define Java. 2. What is a Class? 3. What is an Object? 4. What is an Instance? CS6501 - Internet programming Unit- I Part - A 1 Define Java. Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed to have the "look

More information