Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Object oriented programming Lab Activity for Week 2 [T/F] [T/F] [T/F] [T/F] [T/F] 1. 1. [T/F] I. State whether the following statements are True or

image text in transcribed

image text in transcribed

image text in transcribed

Object oriented programming

Lab Activity for Week 2 [T/F] [T/F] [T/F] [T/F] [T/F] 1. 1. [T/F] I. State whether the following statements are True or False a. Java is a procedure oriented programming language. b. Java is an architectural neutral language. c. Java Virtual Machine is the interpreter in java. d. We can write java programs without a class. e. The execution of every java program starts from the main method. f. The Scanner class is used to create output objects. g. The java programs can run without compiling them. h. The classes built in the java library contain many packages. The main method is a dynamic method. The filename.class will be run by Java Virtual Machine. k. There must be only one main method and many classes in a java program. Some methods in java need not be specified with the return type. m. The users are allowed to create simple user defined types in java. n. The class definition may be empty in java. 6. Every java program will start its execution from main method. p. An instance of a class is called a method. q. The java compiler compiles .java file and gives the .class file. r. The true is a boolean value in java. s. It is possible to run a java application program without main method. |t. Binding data and methods together is called encapsulation. lu. A constructor of a class is used to initialize the data members. V. The Math class is defined in java.util package of java library. . [T [T [T/F] [T/F] [T/F] a) Find the output of the following code 1. public class Q1{ public static void main(String [] args) { System.out.println(2+2+"=result"); System.out.println("result="+2+2); } } 2. public class Q2 public static void main(String[] arg) { oolean bl=true; while(51){ int a=0; a++; System.out.println(a); bl=false;}}} 3. public class Q3 { public static void main(String[] arg) { int a=1; int b=4; int c=4; System.out.println("NCT+a+b+c); }} 4. public class Q4 static String a; static double b; public static void main(String[] arg) { System.out.println(a+b); } 5. public class Q5{ public static void main(String[] arg) { int a=3; while(a8) break; a+=4; System.out.println(a); }}} 6. public class Q6{ public static void main(String[] arg) ( double a=11.5; double b=0.5; System.out.println(a+b+FF); } } 7. public class Q7{ public static void main(String[] arg){ int i; for(i=1;ib; int d=c?a:b: System.out.println(d); }}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago

Question

3. What strategies might you use?

Answered: 1 week ago