100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

CNIT 325 Questions and Answers Rated A+

Puntuación
-
Vendido
-
Páginas
11
Grado
A+
Subido en
30-01-2024
Escrito en
2023/2024

CNIT 325 Questions and Answers Rated A+ To compile: javac MyFirstP Will produce: MyFirstP To execute: java MyFirstProgram Java Class is a design construct, includes data (attributes) and behavior (methods) Object The living version of a class; "physical" version of the design construct class is like a house blueprint object is the house "Object is an instance of a class" Encapsulation "Data hiding" The idea of safeguarding data inside behavior. Access to the data is controlled by the behavior. In a class, we control the data using behavior (methods) Get methods Access the data within an object. Accessor methods (do not change the data) Set methods Update/set the data within an object. Mutator methods (mutate/change the data) Constructors how to initialize an object. Two types: default, user defined Default constructors Every class automatically has a constructor. For the person class, Person p = new Person(); , takes no arguments. Can be used if no other constructor is defined. Constructor Example Public class Person { public static void main(String [] args) { Person p = new Person(); //default constructor } } User defined constructors Can define as many as you want (within reason), default constructor goes away. takes no arguments or can take arguments. Example: Person p = new Person(18, "brown"); What is good design? Software is never finished, software is never perfect. Inheritance Class can inherit data and behavior from a parent class. Can be used to secure the data Access Modifiers Public Private Protected Package Inheritance Example (person class) (Gradstudent->Student->Person) public class Person { String PUID; String SSN; } public class Student { boolean attendGoldRush; double gpa; } public class GradStudent { boolean thesisComplete; } Public Available inside and outside the class Private Available only inside the class Protected Available inside the class and in the inheritance hierarchy Abstract Class Occurs as design becomes larger and the base class becomes more general. Abstract classes will never be instantiated. (Maybe Person will never be created, so we can make it an abstract class) Abstract Class Example (Person) public abstract class Person { .... public abstract String getSSN() {...} public abstract void setSSN(String s) {...} } Design hints Don't always use protected Use inheritance to model the "is a" relationship Place common operations in the superclass. Use polymorphism UTF-8 Most common for internet UTF-16 Used for Java Text Streams Text is the most common stream. In Text, 1234 is saved as "1234", in Binary, it is saved as 00 00 04 D2 To write text: PrintWriter out = new PrintWriter("", "UTF-8"); To save an object: out.WriteObject(person); XML Is NOT: A replacement for HTML A presentation format A programming language A network transfer protocol A database XML is: A meta markup language for textual documents/textual data Possible advantages of XML Truly portable data Easily readable by human users Very expressive Very flexible/customizable Easy to use from programs Easy to convert into other representations Many additional standards and tools Widely used and supported Document Markup Adds structural and semantic information to documents (e.g. Sections, subsections, theorems, cross references, index entries, named entities) (Abstract Windowing Toolkit) Introduced w/ java 1.0 Classes are divided into three main categories: graphics(colors, fonts, shapes), components(windows, buttons, menus), layout managers (control the positioning of components on screen) Swing With Java 2, swing classes were introduced. Many awt components have improved swing counterparts (AWT Button -> JButton). Swing does not replace awt. Component An abstract class Superclass of all gui components except menu components and class CheckBoxGroup Container The superclass for all components that contain other components defines add(), for adding components to a container Window A top level window with no border or menu bar Rarely instantiated (subclasses more useful) Frame A window with a title bar can have a menu bar top-level window for java AWT-based applications Panel A container that must be contained within another container Does not have its own window Applet A subclass of panel actually part of the t package, not awt AWT limitations Look & feel differs slightly across platforms, awt components limited to those that are available on all platforms (Lowest common denominator) Labels and Image icons Label is used to provide info to user or add decoration A Swing label is defined by the JLabel class It can incorporate an image defined by the ImageIcon class The alignment and relative positioning of the text and image of a label can be explicitly set Buttons Can fall into various categories: push button: generic button that initiates action Check box: a button that can be toggled on or off radio buttons: a set of buttons that provide mutually exclusive options(only one can be toggled at a time) Radio buttons are grouped using the ButtonGroup class Check boxes generate Item state changed events when toggled. Combo Boxes Displays a particular option with pull down menu from which user can choose a different option Combo box cannot be emptied unless it has something in it Creating a frame By default, frame is set to 0x0 pixels, setSize() is used. The show() message is sent to the frame to make it visible Border Layout Default for a frame Components layed out by this manager don't really get to have their preferred size Flow Layout Default for a panel Acts like a word processor, except w/ components instead of words Each component is the size it wants to be Laid out left to right, uses "word wrap" Box Layout Each component has its own size, components placed in order they are added, BUT can stack components vertically or horizontally (instead of automatic wrapping) Tool tips Provide a short pop up description when mouse cursor momentarily rests on a component Mneumonics Keyboard shortcuts that can be added to graphical objects

Mostrar más Leer menos
Institución
CNIT 325
Grado
CNIT 325









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CNIT 325
Grado
CNIT 325

Información del documento

Subido en
30 de enero de 2024
Número de páginas
11
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$9.99
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada


Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
StellarScores Western Governers University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1899
Miembro desde
2 año
Número de seguidores
864
Documentos
21000
Última venta
21 horas hace
Your Academic Hub: Documents, Study Guides, Summaries, Essays, and Exclusive Package Deals.

Welcome to my comprehensive academic resource store! At my online hub, I offer a vast array of meticulously crafted documents, study guides, summaries, and essays to support your educational journey. I understand the value of accuracy and completeness, which is why all my materials are verified and kept up-to-date with the latest versions. But that's not all! I also offer exclusive package deals and bundles to provide you with cost-effective solutions for your academic needs. Whether you're a student looking for study aids or seeking in-depth knowledge, my store is your one-stop destination for reliable, top-quality materials that can propel your learning experience to new heights. Explore my offerings and unlock the keys to academic success today!

Lee mas Leer menos
4.0

434 reseñas

5
234
4
78
3
60
2
24
1
38

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes